Git Product home page Git Product logo

Comments (6)

arianagiorgi avatar arianagiorgi commented on July 28, 2024 1

After updating to 0.5.19 it seems the issue with the data disappearing on vertical line charts with dates is fixed, and works as expected in the line chart as well.

from chartwerk-editor.

achavez avatar achavez commented on July 28, 2024

OK, clarifying the root cause of this a bit: It happens when the date sniffer encounters dates that are purely numeric and are therefore Numbers, such as column of years:

Date	CBM	GQS
2015	45.47	32.84
2015	45.14	32.19
2015	49.05	34.23
2015	50.32	34.89
2015	49.25	36.48

FWIW, if I add a .toString() to the offending .trim() I end up with rendering errors in D3 so I'm sure there's some complexity to this I'm missing ...

from chartwerk-editor.

hobbes7878 avatar hobbes7878 commented on July 28, 2024

I think I may have an idea why this happening...

So in updating csvtojson with the last PR I remember I consciously turned off type sniffing here. The idea is that all data should come through as strings and the template would then convert it to the correct type for the chart. Apparently those numeric dates are still coming through as numbers.

My instinct is to just ensure conversion to string at the line that's failing.

That may mean you'll also need to update your templates to expect strings instead of numeric types.

from chartwerk-editor.

hobbes7878 avatar hobbes7878 commented on July 28, 2024

Hmm... I'm not able to replicate the same issue on numeric dates with our line template using this data:

Month	Coal	Natural gas	Wind and solar
2003	51.26	15.83	0.73
2004	52.02	16.56	0.81
2005	51.33	16.22	1
2006	49.72	18.58	1.11
2007	49.08	18.88	0.96
2008	49.09	21.38	0.77

Dates and data come through parsed correctly.

from chartwerk-editor.

achavez avatar achavez commented on July 28, 2024

@hobbes7878 Weird. Thanks for looking at that. I'll dig deeper and see what I can figure out. For now we've gotten them working again by rolling back to 0.5.17.

from chartwerk-editor.

hobbes7878 avatar hobbes7878 commented on July 28, 2024

@achavez no problem. I'll hang on for what you find out in debugging. As soon as I can replicate an issue, happy to fix it.

from chartwerk-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.