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

VisList properties overidden upon refresh_source initialization #68

Closed
dorisjlee opened this issue Aug 20, 2020 · 3 comments
Closed

VisList properties overidden upon refresh_source initialization #68

dorisjlee opened this issue Aug 20, 2020 · 3 comments
Assignees
Labels
bug Something isn't working priority high priority tasks (for dev) test Adding or Modifying test classes

Comments

@dorisjlee
Copy link
Member

When properties are specified in the Vis and fed inside the VisList, the refresh_source goes through the parser, validator and compiler. At the compiler stage, the Vis properties gets overridden by the automatically determined values. We should tolerate specified title, mark and other Vis properties to override the automatically determined values.

This is an example test that evaluates this, the last two line fails because the title and mark takes on the new values.
This example should be added to the test suite once we resolve this issue.

df = pd.read_csv("lux/data/olympic.csv")
df["Year"] = pd.to_datetime(df["Year"], format='%Y') # change pandas dtype for the column "Year" to datetype
from lux.vis.VisList import VisList
from lux.vis.Vis import Vis
vcLst = []
for attribute in ['Sport','Year','Height','HostRegion','SportType']: 
    vis = Vis([lux.Clause("Weight"), lux.Clause(attribute)],title="overriding dummy title",mark="line")
    vcLst.append(vis)
vc = VisList(vcLst,df)
for v in vc: 
    assert v.title=="overriding dummy title" # AssertionError
    assert v.mark=="line" # AssertionError
@dorisjlee dorisjlee added bug Something isn't working priority high priority tasks (for dev) test Adding or Modifying test classes labels Aug 20, 2020
@dorisjlee
Copy link
Member Author

This issue also causes the string title property for Date to be overridden.
image (8)
Fixing this issue should also resolve the Date issue.

@dorisjlee dorisjlee self-assigned this Aug 25, 2020
@dorisjlee
Copy link
Member Author

Now supporting a custom title override by avoiding unnecessary calls to enumerate_collection. Mark and channel override non-trivial since we need to extend determine_encoding channel assignment to work with the non-default, custom mark.

dorisjlee added a commit that referenced this issue Aug 25, 2020
* add intent with getters and setters
* make min_max private property
* make mark private property (#68)
* added tests for setting intent for Vis and VisList
@dorisjlee
Copy link
Member Author

Currently, we don't support mark override on Vis, since there can be conflicts with the input intent (e.g. user intent involves only a single quantitative attribute, but sets mark as scatterplot). We can revisit this once there are a better validator and parser that catches these issues. For now, _mark is set as private property.

dorisjlee added a commit that referenced this issue Sep 1, 2020
dorisjlee added a commit that referenced this issue Sep 1, 2020
dorisjlee added a commit that referenced this issue Sep 1, 2020
* add intent with getters and setters
* make min_max private property
* make mark private property (#68)
* added tests for setting intent for Vis and VisList


Former-commit-id: 3e55707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority high priority tasks (for dev) test Adding or Modifying test classes
Projects
None yet
Development

No branches or pull requests

2 participants