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

Polyjs.data Implicit Type Coercion Buggy #6

Open
jobowoo opened this issue May 18, 2013 · 0 comments
Open

Polyjs.data Implicit Type Coercion Buggy #6

jobowoo opened this issue May 18, 2013 · 0 comments

Comments

@jobowoo
Copy link

jobowoo commented May 18, 2013

When providing a list of data to polyjs.data without a meta argument the resulting polyjs data object produces strange results even for sane inputs. This causes the data not to be rendered correctly in the resulting chart. Please see the example below.

var d = [{"foo": "Period 1"}]
var polydata = polyjs.data(d)

Expected:

d[0].foo == "Period 1"
polydata.raw[0].foo == "Period 1"

Actual:

d[0].foo == 978336000
polydata.raw[0].foo == 978336000

Once I specify a meta object where the type of foo is cat, the polyjs data object works as expected. While I can see this being a valid workaround, given the benign input, it took me a while to track down. I could see this being a big gotcha for other users. Only one of the examples use the meta field. At the very least, this should be better documented.

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

1 participant