[ckan-dev] Recline.JS problems
Daniel Lombraña González
teleyinex at gmail.com
Fri Jul 27 13:59:47 UTC 2012
Hi,
Just to let you know I finished my work with ReclineJS with this beautiful
time line:
http://www.citizencyberscience.net/t4t-webapp/stats/club.html
The time line shows the users from the CERN project
Test4Theory<http://lhcathome2.cern.ch/>that have contributed more than
1 Billion, with B, of simulated events for
the physics experiments! From the point of view of the development, I would
say that I had to tweak several aspects of the timeline.js library just to
"adapt" some "visuals" regarding the dates (i.e. removing the hour and
minutes, adding the string "On " to the top dates, etc.).
The source code is available here, if you want to have a look, but I guess
it is not really interesting:
https://github.com/citizen-cyberscience-centre/t4t-stats
Cheers,
Daniel
On Tue, Jul 24, 2012 at 1:15 PM, Daniel Lombraña González <
teleyinex at gmail.com> wrote:
> I think I found the solution :-) timeline.render does not work, so if you
> remove it from the code it renders the Timeline :-D
>
>
> On Tue, Jul 24, 2012 at 12:49 PM, Daniel Lombraña González <
> teleyinex at gmail.com> wrote:
>
>>
>>
>> On Tue, Jul 24, 2012 at 12:18 PM, Rufus Pollock <rufus.pollock at okfn.org>wrote:
>>
>>> On 24 July 2012 11:07, Daniel Lombraña González <teleyinex at gmail.com>
>>> wrote:
>>> > Dear all,
>>> >
>>> > I'm trying to use Recline.JS for displaying some data and learning
>>> something
>>> > new, but when I'm following the tutorial I've found some issues:
>>> >
>>> > * Creating the dataset with the following code gives some errors:
>>> >
>>> >
>>> > var dataset = new recline.Model.Dataset({
>>> > records: data
>>> > });
>>> >
>>> >
>>> > So I've tried with this other approach from the source code:
>>> >
>>> > var fields = [
>>> > {id: 'id'},
>>> > {id: 'user_name'},
>>> > {id: 'date', type:'date'}
>>> > ];
>>> >
>>> > var dataset =
>>> > recline.Backend.Memory.createDataset(data,fields);
>>> >
>>> > This one works. After that, I continued with the tutorial, and I found
>>> that:
>>> >
>>> > * dataset.recordCount returns undefined and I do not know why.
>>> > * the same for dataset.records.length, however if you try
>>> > dataset.attributes.records it works
>>>
>>> Have you called dataset.fetch();
>>>
>>
>> I've tried right now, and it does not make any difference :-( I should
>> be doing something wrong.
>>
>>
>>> > I've tried it with my own code and dataset, and with the examples that
>>> are
>>> > provided in the Github repository, but in all the cases I get the same
>>> > "undefined" output. Interestingly, the Grid view works and renders well
>>> > (actually, the first row does not show the right colors, but that's
>>> > something about the CSS and I'm not too worried right now).
>>> >
>>> > Then, after rendering the Grid, I wanted to try with the Timeline. I
>>> > followed the same approach as with the Grid:
>>> >
>>> > var timeline = new recline.View.Timeline({
>>> > model: dataset,
>>> > el: $el
>>> > });
>>> > grid.visible = true;
>>> > grid.render();
>>> >
>>> >
>>> > where $el is a div in the HTML page, and the dataset has the following
>>> > fields:
>>> >
>>> > [{id, user_name, date}]
>>> >
>>> > While the Grid works well, the Timeline does not show anything, and I
>>> do not
>>> > get any console error, so I do not know where is the problem. Can you
>>> help
>>> > me and let me know what I'm doing wrong? Thanks in advance!!!
>>>
>>> Can you post your full code somewhere?
>>>
>>
>>
>> http://paste.ubuntu.com/1107973/
>>
>> Thanks in advance!!!
>>
>> Daniel
>>
>>>
>>> Rufus
>>>
>>> _______________________________________________
>>> ckan-dev mailing list
>>> ckan-dev at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>
>>
>>
>>
>> --
>>
>> ··························································································································································
>> http://github.com/teleyinex
>> http://www.flickr.com/photos/teleyinex
>>
>> ··························································································································································
>> Por favor, NO utilice formatos de archivo propietarios para el
>> intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
>> o cualquier otro que no obligue a utilizar un programa de un
>> fabricante concreto para tratar la información contenida en él.
>>
>> ··························································································································································
>>
>
>
>
> --
>
> ··························································································································································
> http://github.com/teleyinex
> http://www.flickr.com/photos/teleyinex
>
> ··························································································································································
> Por favor, NO utilice formatos de archivo propietarios para el
> intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
> o cualquier otro que no obligue a utilizar un programa de un
> fabricante concreto para tratar la información contenida en él.
>
> ··························································································································································
>
--
··························································································································································
http://github.com/teleyinex
http://www.flickr.com/photos/teleyinex
··························································································································································
Por favor, NO utilice formatos de archivo propietarios para el
intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
o cualquier otro que no obligue a utilizar un programa de un
fabricante concreto para tratar la información contenida en él.
··························································································································································
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120727/c3b98eae/attachment-0001.html>
More information about the ckan-dev
mailing list