[ckan-dev] Data viewer oddities

Eduardo Santos eduardo.edusantos at gmail.com
Mon Apr 16 15:05:53 UTC 2012


Hi everybody,

I'm new to the list and I don't know if I'm making the question on the
right place, but this post is exactly what I've been trying to do last week
and I wasn't able to finish yet. Where's this dataview API? I can see the
data preview is shown using jQuery in application,js, but I couldn't find
this data viewer with grids and graphs.

Can you tell me wich files are needed and how I could customize this viewer
interface? I'm using Ckan 1.6.



2012/4/16 Rufus Pollock <rufus.pollock at okfn.org>

> On 16 April 2012 10:14, Mark Wainwright <mark.wainwright at okfn.org> wrote:
> > There seem to be a few bugs in the data viewer, which I had a quick
> > play with when Jonathan Gray asked via Twitter: "how can I reload a
> > graph? E.g. if I want to see date on the x axis for the gold example?
> > http://thedatahub.org/dataset/gold-prices"
> >
> > (i) I believe the answer to J's question should be that it
> > automatically reloads when you choose a new variable, and I believe
> > also that it actually does this; but I suspect that Jonathan is not
> > seeing it happen because the labelling of the axes is completely
> > wrong, and doesn't change when he changes the variable from '__id__'
> > to 'date' (the shape of the graph is the same).
> >
> > But besides the axis-labelling problems, there are other problems with
> this.
> >
> > (ii) Try plotting 'date' against '__id__'. The graph should be a
> > straight line, but it is blank.
> >
> > (iii) Most strangely, try plotting __id__ against __id__. The result
> > is a graph that wiggles up and down in a mystifying way - it is not
> > the prices data, but nor is it the straight line one would naturally
> > expect!
>
> Have you *sorted* the data? By default the data does not come back in
> sorted form. This combined with a "pseudo-bug" regarding the handling
> of numeric data which is in string form will result in all the
> behaviour you mention:
>
> * Because the data was imported as a CSV all values were interpreted
> as *strings* when I uploaded the data
> * As such when plotting the graph Flot will simply use index of the
> data point was that the x-axis value (because it does not know the
> data is numeric)
> * Thus you point 1 with, say, values __id__ = 500, date=.... will get
> plotted at x-axis value 1 even if you choose x-axis to be __id__ or
> date
> * Because the data is not sorted you won't get a straight line even
> when plotting against __id__
>
> The fix for this which is definitely poor UX would be:
>
> * Ability to configure a default sort field
> * Better casting of data upon upload (so numeric data in csv would get
> recognized as such ...) - use of mapping in elasticsearch
> * Better casting of data in flot graph
>
> Rufus
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>



-- 
Eduardo Santos
Analista de Sistemas

http://eduardosan.wordpress.com
http://twitter.com/eduardosan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120416/ec512a91/attachment-0001.html>


More information about the ckan-dev mailing list