Git Product home page Git Product logo

Comments (14)

StephenOTT avatar StephenOTT commented on August 22, 2024

I will be looking at adding this to Chartkick in the next few weeks. At least a simple version or a start.
Will be using it as part of my GitHub Analytics project:

https://github.com/StephenOTT/GitHub-Analytics

from chartkick.

StephenOTT avatar StephenOTT commented on August 22, 2024

Okay i have the basic code up and running with chartkick.

The item that will need to be modified in the core code will be the loading the timeline package:

google.load("visualization", "1.0", {"packages": ["corechart", "timeline"]});

Original code covers only the corechart package. But we only want to have to load the timeline package when needed.

@ankane thoughts?

from chartkick.

StephenOTT avatar StephenOTT commented on August 22, 2024

Okay so biggest problem at the moment is now the precessSeries function
Specifically the loop that "rights" the format. The problem is the second loop that makes the assumption that all data series will only have 2 data columns. Timelines has 3 data columns.

    // right format
    for (i = 0; i < series.length; i++) {
      data = toArr(series[i].data);
      r = [];
      for (j = 0; j < data.length; j++) {
        //console.log(data.length)
        key = data[j][0];
        key = time ? toDate(key) : toStr(key);
        r.push([key, toFloat(data[j][1])]);
      }
      if (time) {
        r.sort(sortByTime);
      }
      series[i].data = r;
    }
 for (j = 0; j < data.length; j++) {
        //console.log(data.length)
        key = data[j][0];
        key = time ? toDate(key) : toStr(key);
        r.push([key, toFloat(data[j][1])]);
      }

So this loop above needs to be rebuilt to accommodate multiple columns

Once rebuilt it will actually make the code much more robust and valuable.

from chartkick.

StephenOTT avatar StephenOTT commented on August 22, 2024

My thinking is that that this entire "right format" loop should not be included as a default. It should be optional.

For a few reasons:

  1. Right now every data value is reprocessed on the client side to put into the new array. This means all data is doubled for each chart occurrence.. correct?. This is a memory concern.
  2. Not everyone may want to sort their data from A to Z.
  3. This loop makes the assumption that the data is not in the correct format or order for every dataset. This should be an optional processing option.
  4. It also assumes that every dataset has only 2 data columns. This is a pretty fair assumption because of the CoreCharts package pretty much deals with 2 columns of data (mainly). But in the Timeline example and I am sure others this assumption becomes problematic.

from chartkick.

StephenOTT avatar StephenOTT commented on August 22, 2024

NegativeValues Function will also need to be adjusted

from chartkick.

ankane avatar ankane commented on August 22, 2024

@StephenOTT I'm trying to figure out where additional chart types fit into chartkick, like this and sparklines (see #7). As you've seen, adding these additional chart types require a number of changes to the code, and chart types that are exclusive to Google Charts breaks compatibility w/ Highcharts.

from chartkick.

StephenOTT avatar StephenOTT commented on August 22, 2024

@ankane Ya i have been going over the code for several hours working through some design patterns to see what would be just modified or what has to be rebuilt to accommodate a more diverse structure.

Issue functions I have identified as problematic for future changes are:

  1. processSeries
  2. createDataTable
  3. and a few parts of jsOptionsFuc - biggest issue is the validity of the results that negativeValues function returns in its current state.

from chartkick.

StephenOTT avatar StephenOTT commented on August 22, 2024

I keep coming back to the the opinion that rejigging some of the code into a more modular Presentation and Data Manipulation would be beneficial for both Google Charts, Highchart and which ever other systems are used in the future.

Data Manipulation is not always needed and while defaults would be beneficial for a typical use case, a lot of the current code in the above functions are logic to determine when or how to modify the structure. If we strip the decision logic but keep manipulation logic and move the choice to activate certain manipulations to the top level for the user to decide with a T/F array or object of "manipulations", this would support people to create all sorts of extensions and additional data manipulations for different situations if needed. It would always support the more complex versions of the charts that usually contain additional structure within the data series.

from chartkick.

dgwmfo avatar dgwmfo commented on August 22, 2024

Would really like to see support for the Timeline Chart in Chartkick. It's exactly what I need in a current project.

from chartkick.

samurailink3 avatar samurailink3 commented on August 22, 2024

Same here, really needing timeline functionality.

from chartkick.

pchaganti avatar pchaganti commented on August 22, 2024

+1

from chartkick.

ankane avatar ankane commented on August 22, 2024

Timelines have arrived in the latest version.

from chartkick.

yagudaev avatar yagudaev commented on August 22, 2024

is it possible to use timelines with highcharts?

from chartkick.

yagudaev avatar yagudaev commented on August 22, 2024

Found this: http://highcharts.uservoice.com/forums/55896-general/suggestions/804783-gantt-chart. Highcharts also has this on their roadmap for an official implementation. We could just use that for now in chartkick to allow for timeline to work

from chartkick.

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.