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

[BUG] Color scheme not persisting #5410

Open
1 of 3 tasks
sm-alejandro opened this issue Jan 20, 2025 · 0 comments
Open
1 of 3 tasks

[BUG] Color scheme not persisting #5410

sm-alejandro opened this issue Jan 20, 2025 · 0 comments
Labels
bug Bug fixes

Comments

@sm-alejandro
Copy link

sm-alejandro commented Jan 20, 2025

Describe the problem

When starting the app with session.color_scheme = None I can see the colorscheme of the dataset (dataset.app_config.color_scheme) being applied (also in the json editor).
But when selecting another dataset and coming back, the colorscheme saved in the dataset is not being loaded, instead the default colors are shown (also in the json editor).

According to this: "Each time you load a new dataset, the color scheme will revert to that dataset’s default color scheme (if any) or else the global default color scheme." from here I expected it to load the colorscheme of the dataset which I can see when I load the dataset in the terminal.

The colorscheme I'm setting is this one:

color_scheme = fo.ColorScheme(
    color_by="field",
    opacity=0.7,
    color_pool=["#ffffff"],
    fields=[
        {
            "path": "reference",
            "fieldColor": "#0000ff",
        },
        {
            "path": "result_ok",
            "fieldColor": "#00ff00",
        },
        {
            "path": "result_err",
            "fieldColor": "#ff0000",
        },
    ],
)

Code to reproduce issue

dataset.app_config.color_scheme = color_scheme
dataset.save()
session.color_scheme = None
session.wait()

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 22.04): Windows 11
  • Python version (python --version): 3.11.9
  • FiftyOne version (fiftyone --version): 1.2.0
  • FiftyOne installed from (pip or source): pip

Other info/logs

When setting as default from the json editor the following message appears in the browser terminal:

Uncaught ReferenceError: setActiveColorModalField is not defined
    onClick http://localhost:5151/assets/index-I2IgC9BK.js:9293
    Nb http://localhost:5151/assets/index-I2IgC9BK.js:30
    Tb http://localhost:5151/assets/index-I2IgC9BK.js:30
    Ub http://localhost:5151/assets/index-I2IgC9BK.js:30
    nf http://localhost:5151/assets/index-I2IgC9BK.js:30
    se$3 http://localhost:5151/assets/index-I2IgC9BK.js:30
    hd http://localhost:5151/assets/index-I2IgC9BK.js:30
    Rk http://localhost:5151/assets/index-I2IgC9BK.js:33
    Jb http://localhost:5151/assets/index-I2IgC9BK.js:30
    hd http://localhost:5151/assets/index-I2IgC9BK.js:30
    fd$1 http://localhost:5151/assets/index-I2IgC9BK.js:30
    ed http://localhost:5151/assets/index-I2IgC9BK.js:30

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance
    from the FiftyOne community
  • No. I cannot contribute a bug fix at this time
@sm-alejandro sm-alejandro added the bug Bug fixes label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

No branches or pull requests

1 participant