jacomyal / sigma.js

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges
https://www.sigmajs.org/
MIT License
11.28k stars 1.59k forks source link

Background Image #1333

Open jackfrost1411 opened 1 year ago

jackfrost1411 commented 1 year ago

Hello, I want to add a background image to the graph. How can I do this? Do sigma js have such a feature or property?

Yomguithereal commented 1 year ago

It mostly depends if you need it to move in sync with the graph camera or not. If you don't, simple html/css should suffice. If you need it to move, sigma.js does not provide this option per se but the renderer has a beforeRender & afterRender event you can listen to to make this work.

tmsrise commented 1 year ago

@Yomguithereal Could you go into more detail using the events to move the background and what other pieces are needed? I'd greatly appreciate it.

Yomguithereal commented 9 months ago

Sorry @tmsrise didn't have the time. This is basically the same concept as what's being demonstrating here with custom cluster labels: https://github.com/jacomyal/sigma.js/blob/main/examples/clusters-labels/index.ts#L74