antvis/G6

How do I set the theme for G6? #4416

rkedward posted onGitHub

Describe the bug

G2 has a theme option that can be set to 'dark' or 'light'. How do I set the theme for G6? I can't find it in the api documentation and setting a theme attribute doesn't appear to do anything.

Your Example Website or App

private dev environment

Steps to Reproduce the Bug or Issue

  1. Configure example graph with only required cfg and 3 nodes and 6 edges. Graph displays for a light theme.
  2. Set the 'theme' top level attribute to 'dark'. Nothing changes.

Expected behavior

Colors for a dark background and theme.

Screenshots or Videos

No response

Platform

  • OS: Linux server / windows browser
  • Browser: Chrome
  • Version: Version 111.0.5563.147

Additional context

I search the docs and and didn't find theme attribute. I'm wondering if G6 is capable of setting a dark theme and how I go about doing that if it is.


The G6 5.0 has provide a theme mechanism, you can register custom theme and switch theme by the graph.setTheme API

posted by Aarebecca 11 months ago

Fund this Issue

$0.00
Funded

Pull requests