Coder Social home page Coder Social logo

Comments (11)

wa0x6e avatar wa0x6e commented on May 18, 2024

Can you give a concrete example ?

As the domains are infinite, it'll be pretty hard to do, or are you talking about something else ?

from cal-heatmap.

aionescu-zz avatar aionescu-zz commented on May 18, 2024

Can you give a concrete example ?

Let's say I have data loaded for 12 domains (12 months groups).
If where the chart is displayed, there's enough place, than all the 12 domains will show.
If however I need to place the chart in a 2-column layout, than I can show only 6 or 7 domains at once.
I would like to be able to scroll the same way visually how the user would use the cal-heatmap browse controls
inside this loaded once domain (but this to trigger no further Ajax requests, since all the data was already loaded).

As the domains are infinite, it'll be pretty hard to do, or are you talking about something else ?

Yes. Just scrolling. The domains might be infinite, but there's a "first" and a "last" item that will correspond to a domain.

from cal-heatmap.

wa0x6e avatar wa0x6e commented on May 18, 2024

Are you talking about responsive design ? Where you want the calendar to resize to show less domains when asked to ?

Or you want to save ajax request by loading more datas than showed with the first request ?

from cal-heatmap.

aionescu-zz avatar aionescu-zz commented on May 18, 2024

Or you want to save ajax request by loading more datas than showed with the first request ?

Yes. Not just save Ajax requests, but server code too: some data comes from other systems where would complicated to modify it ( to have extra parameters for the browsing), since we have no control over it, so just scrolling would be enough.

from cal-heatmap.

wa0x6e avatar wa0x6e commented on May 18, 2024

From the server data, you want to preload all the data it's returning, or you want to filter them first ? (limiting with a first and end date).

from cal-heatmap.

aionescu-zz avatar aionescu-zz commented on May 18, 2024

From the server data, you want to preload all the data it's returning, or you want to filter them first ? (limiting with a first and end date).

From a user's perspective I don't really know what's the difference between "preload" and "filter" :).
Of course I wouldn't want to give an extra first and end property since there's already a start and range property, so the chart can figure out everything else.

What I want is just an extra setting (e.g. scroll:true or even better: browsing:'scroll' ). When this is used, and the user clicks on the browsing buttons, the chart would "scroll" or visibly "shift" or "re-render" with one domain at left or right if there's data in those previous or next domains.

from cal-heatmap.

wa0x6e avatar wa0x6e commented on May 18, 2024

When this is used, and the user clicks on the browsing buttons, the chart would "scroll" or visibly "shift" or "re-render" with one domain at left or right if there's data in those previous or next domains.

I'm wondering how do you fill these datas in the "hidden" domain. I believe you're loading these in the same ajax request than the visible domains.

Let's say the ajax request can return datas for a whole month, and you're just displaying one week. So for the remaining 3 weeks, it'll be loaded automatically the first time, so when browsing, there's no more ajax request.

What I want to know is if you want to use all the datas return by the server (3 weeks), or want to limit them with a first and end date (just use the data for let's say 2 weeks).

from cal-heatmap.

aionescu-zz avatar aionescu-zz commented on May 18, 2024

What I want to know is if you want to use all the datas return by the server (3 weeks), or want to limit them with a first and end date (just use the data for let's say 2 weeks).

I want to use the entire data (4 weeks) loaded in one single AJAX request. The chart would scroll to the left or to the right, so jumping one domain (like it is doing with browsing too) until there's a domain with no more data.

from cal-heatmap.

wa0x6e avatar wa0x6e commented on May 18, 2024

until there's a domain with no more data

I guess you want to disable browsing beyond certain date ?

from cal-heatmap.

aionescu-zz avatar aionescu-zz commented on May 18, 2024

see here an illustration. I hope it helps http://www.asciiflow.com/#Draw5106642043834590516/1312689001

I guess you want to disable browsing beyond certain date ?

If there's no more data in the next domain than can be the domains where the scrolling ends on the right or the left side.

from cal-heatmap.

wa0x6e avatar wa0x6e commented on May 18, 2024

Maybe you can do that "outside" cal-heatmap ? With the new features added since version 3, it should be possible, or close.

First, don't pass the data's API url directly to cal-heatmap, fetch the data first and extract the first and last date, then pass them to init() via the minDate and maxDate => your calendar is now bounded.

Now that you have a json object, just pass it directly to cal-heatmap via data, since it can takes directly a json object.

Example:

var data = d3.json('www.api.com/data.html');

// Extract the timestamps
var dates = Object.keys(data);

// Convert all string timestamp to integer
dates.map(function(d) { return parseInt(d, 10); });

// Sort the dates
dates.sort();

var cal = new CalHeatMap();
cal.init({
   data: data,
   minDate: dates.shift(),
   maxDate: dates.pop()
});

from cal-heatmap.

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.