d3Network icon indicating copy to clipboard operation
d3Network copied to clipboard

ensure node labels are not obstructed by other nodes

Open maxcw opened this issue 11 years ago • 4 comments

I have a dense network, and when my mouse hovers over nodes, the label is sometimes obstructed by other nodes. I would love it if the text was 'on top of' all nodes.

I tried my hand at this myself in the code below. The weird thing is that the stand-alone version of the code works fine when opened as an html file. But when I give it to shiny using cat() and htmlOutput(), the next labels appear at the bottom of the screen.

maxcw avatar Jul 22 '14 03:07 maxcw

Can you send the code as a gist. It hasn't been rendered very well in the issue.

christophergandrud avatar Jul 22 '14 06:07 christophergandrud

Hi Christopher,

The code is located at:

https://gist.github.com/maxcw/7fb0b8dbaa10efb79d41

I've never used a gist before, so let me know if that doesn't work. Just to reiterate, this is a sample of what I plug into shiny:

In server.R I have:

output$networkPlot <- {

    conn=file('d3network_mod.html',open='r')
    cat(readLines(conn),sep='\n')
    close(conn)

}

and in the ui.R I have:

htmlOutput('networkPlot')

The free-standing version of the html file looks fine in when opened directly by browsers. But when d3network_mod.html is plugged into Shiny, the node labels show up at the bottom left corner!

Thank You For Your Help,

Max

Max Watson, PhD L-3 Data Tactics 7901 Jones Branch Dr., Suite 700 McLean, VA 22102 Cell: (760) 274-4693 Office: (571) 482-7109 www.Data-Tactics.comhttp://www.data-tactics.com/


From: Christopher Gandrud [[email protected]] Sent: Tuesday, July 22, 2014 2:23 AM To: christophergandrud/d3Network Cc: Max Watson Subject: Re: [d3Network] ensure node labels are not obstructed by other nodes (#20)

Can you send the code as a gisthttps://gist.github.com/. It hasn't been rendered very well in the issue.

— Reply to this email directly or view it on GitHubhttps://github.com/christophergandrud/d3Network/issues/20#issuecomment-49702495.

maxcw avatar Jul 22 '14 14:07 maxcw

The gist looks good. Thanks!

I'll try to carve out a bit of time to look at this within the week.

On Tue, Jul 22, 2014 at 3:08 PM, maxcw [email protected] wrote:

Hi Christopher,

The code is located at:

https://gist.github.com/maxcw/7fb0b8dbaa10efb79d41

I've never used a gist before, so let me know if that doesn't work. Just to reiterate, this is a sample of what I plug into shiny:

In server.R I have:

output$networkPlot <- {

conn=file('d3network_mod.html',open='r') cat(readLines(conn),sep='\n') close(conn) }

and in the ui.R I have:

htmlOutput('networkPlot')

The free-standing version of the html file looks fine in when opened directly by browsers. But when d3network_mod.html is plugged into Shiny, the node labels show up at the bottom left corner!

Thank You For Your Help,

Max

Max Watson, PhD L-3 Data Tactics 7901 Jones Branch Dr., Suite 700 McLean, VA 22102 Cell: (760) 274-4693 Office: (571) 482-7109 www.Data-Tactics.comhttp://www.data-tactics.com/


From: Christopher Gandrud [[email protected]] Sent: Tuesday, July 22, 2014 2:23 AM To: christophergandrud/d3Network Cc: Max Watson Subject: Re: [d3Network] ensure node labels are not obstructed by other nodes (#20)

Can you send the code as a gisthttps://gist.github.com/. It hasn't been rendered very well in the issue.

— Reply to this email directly or view it on GitHub< https://github.com/christophergandrud/d3Network/issues/20#issuecomment-49702495>.

— Reply to this email directly or view it on GitHub https://github.com/christophergandrud/d3Network/issues/20#issuecomment-49743484 .

christophergandrud avatar Jul 22 '14 14:07 christophergandrud

Thank you for looking at my code!

Max Watson, PhD L-3 Data Tactics 7901 Jones Branch Dr., Suite 700 McLean, VA 22102 Cell: (760) 274-4693 Office: (571) 482-7109 www.Data-Tactics.comhttp://www.data-tactics.com/


From: Christopher Gandrud [[email protected]] Sent: Tuesday, July 22, 2014 10:27 AM To: christophergandrud/d3Network Cc: Max Watson Subject: Re: [d3Network] ensure node labels are not obstructed by other nodes (#20)

The gist looks good. Thanks!

I'll try to carve out a bit of time to look at this within the week.

On Tue, Jul 22, 2014 at 3:08 PM, maxcw [email protected] wrote:

Hi Christopher,

The code is located at:

https://gist.github.com/maxcw/7fb0b8dbaa10efb79d41

I've never used a gist before, so let me know if that doesn't work. Just to reiterate, this is a sample of what I plug into shiny:

In server.R I have:

output$networkPlot <- {

conn=file('d3network_mod.html',open='r') cat(readLines(conn),sep='\n') close(conn) }

and in the ui.R I have:

htmlOutput('networkPlot')

The free-standing version of the html file looks fine in when opened directly by browsers. But when d3network_mod.html is plugged into Shiny, the node labels show up at the bottom left corner!

Thank You For Your Help,

Max

Max Watson, PhD L-3 Data Tactics 7901 Jones Branch Dr., Suite 700 McLean, VA 22102 Cell: (760) 274-4693 Office: (571) 482-7109 www.Data-Tactics.comhttp://www.data-tactics.com/


From: Christopher Gandrud [[email protected]] Sent: Tuesday, July 22, 2014 2:23 AM To: christophergandrud/d3Network Cc: Max Watson Subject: Re: [d3Network] ensure node labels are not obstructed by other nodes (#20)

Can you send the code as a gisthttps://gist.github.com/. It hasn't been rendered very well in the issue.

— Reply to this email directly or view it on GitHub< https://github.com/christophergandrud/d3Network/issues/20#issuecomment-49702495>.

— Reply to this email directly or view it on GitHub https://github.com/christophergandrud/d3Network/issues/20#issuecomment-49743484 .

— Reply to this email directly or view it on GitHubhttps://github.com/christophergandrud/d3Network/issues/20#issuecomment-49746225.

maxcw avatar Jul 22 '14 19:07 maxcw