Skip to content

Use custom images as nodes #308

@qwding101

Description

@qwding101

Hi, thank you for the great work on networkD3!

I’m wondering if there’s any way to use custom images (e.g., PNG or SVG icons) for nodes instead of the default circles in forceNetwork(). My guess is that this isn’t natively supported, but I’m wondering that whether there is any workarounds—as long as they’re compatible with deploying the visualization in an interactive Shiny app.

I know this can be done by another package visNetwork but I greatly prefer the aesthetic of networkD3.

Is there any solution (e.g., injecting custom JavaScript, modifying the HTML output, or overriding node rendering) that would allow this functionality? Thanks!

A minimal .qmd file is attached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions