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

Error in Bar: Value identify as 0 even when the entry exist. #110

Open
nhungbi opened this issue Feb 6, 2024 · 1 comment
Open

Error in Bar: Value identify as 0 even when the entry exist. #110

nhungbi opened this issue Feb 6, 2024 · 1 comment

Comments

@nhungbi
Copy link

nhungbi commented Feb 6, 2024

showingyearerror

As seen in this picture, the Olli incorrectly identified each year as 0 even though they exist. This is done using React and testing on Chrome.

The spec in question is: sampleBar.json.

The dataset is https://raw.githubusercontent.com/Joszek0723/excess_data/main/bar_chart_data.csv.

Also, the issue seems to be fixed if we make the following changes in 'package/core/src/util/selection.ts': from
return !(isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval !== values[i]);
to
return !(isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval != values[i]);. Please let me know if there is a better way to resolve this. Preferably, I would rather use the Olli library as it is without making my changes. Thanks!

@jonathanzong
Copy link
Member

Hello,

Thanks for reporting this bug! I looked into it and believe it should be fixed by this change: eb85864

The issue as I understand it was that we were doing some unnecessary type conversion from a string to a number, which caused a mismatch between the selection predicate and the dataset. I believe this change fixes your example and longer term I think we can clean up the logic for when those type conversions are necessary (mainly only when going back and forth between data and DOM elements).

I can see if we have other minor changes pending and push out a release soon if not.

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

No branches or pull requests

2 participants