Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose label background color and hover color in settings #1357

Closed
Bytenex opened this issue May 6, 2023 · 2 comments
Closed

Expose label background color and hover color in settings #1357

Bytenex opened this issue May 6, 2023 · 2 comments

Comments

@Bytenex
Copy link

Bytenex commented May 6, 2023

Hey,

currently it's not possible to color the label color when hovered or the background which makes it very hard to use on dark background. Currently I have set the font color to grey so it's visible on the dark background and the white hover background. As labelColor is already an object it would be suitable to add these settings to.

labelColor: { color: '#fff', hover: '#000', background: '#fff' }

@Yomguithereal
Copy link
Collaborator

@Bytenex this can be dealt with using a custom label renderer such as this one here: https://github.com/medialab/ipysigma/blob/master/src/custom-label.ts (or if you want to customize the hover part: https://github.com/medialab/ipysigma/blob/master/src/custom-hover.ts)You can easily make your own to add support for a background color. Then you can pass those functions to your sigma instances in the settings as labelRenderer & hoverRenderer.

@jacomyal
Copy link
Owner

After having been thinking a lot on this issue, I decided to not implement it. Right now, sigma's APIs is made so that people who have advanced usecases should write their own label renderers. That's what we do in the demo for instance.

Also, labels rendering APIs might change in the near future (to handle #1319 for instance), so I don't want to commit more code/debt into it.

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

No branches or pull requests

3 participants