Code Monkey home page Code Monkey logo

Comments (8)

danh32 avatar danh32 commented on June 9, 2024

Sorry for the delay! Was out on vacation.

I will look into this at some point this week. My first thought is perhaps a rounding issue since Spark is using floats for the x,y coords here. But those Y values look incorrect as well, so I'm not entirely sure.

from spark.

FabianTerhorst avatar FabianTerhorst commented on June 9, 2024

I think for timestamps the view needs a different way to calculate the distances between the value points. Maybe a getX override method that needs a date object?

from spark.

Azeirah avatar Azeirah commented on June 9, 2024

Ugh, sorry guys. I found out exactly why this graph appears the way it does.

My points on the x-line have a huge jump, notice halfway, instead of x-incrementing by 1 like it does all the time, it increments with ~230. Clumping all the first few values together on the left, and the other half on the right. I noticed this when I enlarged the graph by a lot.

  "1466546073": 4.0,
  "1466546304": 5.0,

graph

This library is working as expected, the data was at fault.

from spark.

danh32 avatar danh32 commented on June 9, 2024

No worries, thanks for the follow up!

from spark.

Azeirah avatar Azeirah commented on June 9, 2024

Thinking about it a bit more, even though this representation is technically correct, it's not very helpful to the viewer, is it? Should an alternative representation be used when cases like these are detected? Stem graphs would work a little bit better in this case for example.

from spark.

Azeirah avatar Azeirah commented on June 9, 2024

The larger graph would look like this

stem-lg

The sparkstem could look like this, it's a lot clearer.

stem-sm

Not sure if it would be worth the time implementing all heuristics needed to decide what kind of plot to use however, I'm not even sure if that can be reliably done. Or if it is even within the scope of this project.

from spark.

danh32 avatar danh32 commented on June 9, 2024

This seems outside of the scope of Spark to me, since it's no longer a sparkline chart. I also don't think many apps that use Spark would want this behavior. And as you mentioned, detecting this case reliably is quite difficult.

I think Spark should maintain the current behavior, and apps can use custom logic in their SparkAdapters to massage the data however they might want.

from spark.

Azeirah avatar Azeirah commented on June 9, 2024

Thought so, thanks for taking the time to discuss this issue

from spark.

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.