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

split_by color:value mapping for charts should not change due to update() #2198

Open
texodus opened this issue Apr 20, 2023 · 3 comments
Open
Labels
bug Concrete, reproducible bugs

Comments

@texodus
Copy link
Member

texodus commented Apr 20, 2023

Bug Report

Steps to Reproduce:

There is an excellent repo in #1487, copy/pasted below. Note this is only verified on charts - I am fairly certain datagrids do not exhibit this behavior, but it is worth checking them all as well as asserting this behavior via tests.

import asyncio
import perspective
import random
import datetime

async def update(table):
    while True:
        now = datetime.datetime.now()
        data = [{"value": 1, "label": "L1", "timestamp": now}]
        for label in ("L1", "L2", "L3"):
            val = random.random()
            if val > 0.9:
                data.append({"value": val, "label": label, "timestamp": now})
        table.update(data)
        await asyncio.sleep(0.1)
        

schema = {
    "timestamp": datetime.datetime,
    'value': float,
    'label': str,
}

table = perspective.Table(schema, limit=10)
widget = perspective.PerspectiveWidget(table,  column_pivots=['label'], plugin="X/Y Scatter")
asyncio.get_event_loop().create_task(update(table))
widget # show

Expected Result:

L* column values mapped consistently to colors as the data source udpates.

Actual Result:

As the available values shifts from 0-3, the color mapping re-assigns already mapped colors.

Environment:

Chrome

@texodus texodus added the bug Concrete, reproducible bugs label Apr 20, 2023
@texodus texodus changed the title split_by color:value mapping for charts should change reassign due to update() split_by color:value mapping for charts should not change due to update() Apr 20, 2023
@ralphmensah
Copy link

Hi @texodus i just noticed this particular bug has been fixed, I have been working on it for awhile only to notice its been fixed but the issue is still opened.

Screen.Recording.2023-07-06.at.7.25.15.AM.mov

@texodus
Copy link
Member Author

texodus commented Jul 6, 2023

This issue is certainly not fixed and you can see the reproduction in the legend of the video you posted. This particular clip happened to always have 0 and 1 values present, but 2 slides off at 0:002 and the legend drops it from the schema.

@ralphmensah
Copy link

Initially it had the colours changing on update for the same value, but it seems that isn't happening anymore.So I'm guessing that isn't the issue, Sorry I am new on perspective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Concrete, reproducible bugs
Projects
None yet
Development

No branches or pull requests

2 participants