Presenters and formatters (visualisation idea) #53

Open
Stiivi opened this Issue May 10, 2012 · 13 comments

Comments

Projects
None yet
4 participants
@Stiivi
Member

Stiivi commented May 10, 2012

Add presenters/formatters module which will be able to format data for various visualisation libraries.

Also needed:

  • tables (any javascript table libs suggestions?)

Description

  • Presenter: presents whole result
  • Formatter: formats one value (like a table cell)

API suggestion:

  • get_presenter(name) - create a presenter instance, ex.:get_presenter("highcharts")`
  • Presenter.generate(object) - generate presentation of an object

Notes:

  • HTTP query would include a presenter key
@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi May 23, 2012

Member

Looks like presenter will need also cut (for constructing URL links), browser (for additional queries, if necessary, like getting details) and cell detail (to form table headers).

queries in report(report) might contain key presenter to format the query to desired JSON structure (if presenter returns JSON-tranformable object)

Member

Stiivi commented May 23, 2012

Looks like presenter will need also cut (for constructing URL links), browser (for additional queries, if necessary, like getting details) and cell detail (to form table headers).

queries in report(report) might contain key presenter to format the query to desired JSON structure (if presenter returns JSON-tranformable object)

@cwarden

This comment has been minimized.

Show comment
Hide comment
@cwarden

cwarden May 23, 2012

I recommend ccc for an open source visualization solution.

cwarden commented May 23, 2012

I recommend ccc for an open source visualization solution.

@ovnicraft

This comment has been minimized.

Show comment
Hide comment
@ovnicraft

ovnicraft Aug 7, 2012

We can consider too http://www.humblesoftware.com/flotr2/ is a good library for data visualization and shows you data in table and allows you to download data from graphics.

We can consider too http://www.humblesoftware.com/flotr2/ is a good library for data visualization and shows you data in table and allows you to download data from graphics.

@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi Aug 8, 2012

Member

both (ccc and flotr) look useable. the HTTP API might be simple format=flotr2, what about python interface?

result = browser.aggregate(...)
presenter = cubes.presenter("flotr2", options ...)
chart = presenter.present(result, type="pie", ...)

what do you think about this?

Member

Stiivi commented Aug 8, 2012

both (ccc and flotr) look useable. the HTTP API might be simple format=flotr2, what about python interface?

result = browser.aggregate(...)
presenter = cubes.presenter("flotr2", options ...)
chart = presenter.present(result, type="pie", ...)

what do you think about this?

@ovnicraft

This comment has been minimized.

Show comment
Hide comment
@ovnicraft

ovnicraft Aug 8, 2012

I am agree, so you gives

presenter = cubes.presenter("flotr2", options ...)

to allow modularity in UI libraries ?

I am agree, so you gives

presenter = cubes.presenter("flotr2", options ...)

to allow modularity in UI libraries ?

@ovnicraft

This comment has been minimized.

Show comment
Hide comment
@ovnicraft

ovnicraft Sep 3, 2012

@Stiivi when you say:

presenter = cubes.presenter("flotr2", options ...)
chart = presenter.present(result, type="pie", ...)

What contains chart ?, in if we got 2 layers python + JS side we need to response to JS side with JSON so would be better if just dumps result with presenter.

@Stiivi when you say:

presenter = cubes.presenter("flotr2", options ...)
chart = presenter.present(result, type="pie", ...)

What contains chart ?, in if we got 2 layers python + JS side we need to response to JS side with JSON so would be better if just dumps result with presenter.

@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi Sep 7, 2012

Member

@ovnicraft - you are right. chart should in fact be flotr2 representation of a chart (data structure that you directly pass to flotr2 libs). For example, *Presenter objects for JS charts should return objects that can be used by JS libraries, if the lib expects JSON, then it should be JSON. The two steps you mentioned have a reason:

presenter = cubes.presenter("flotr2", options ...)
chart1 = presenter.present(result1, type="pie", ...)
chart2 = presenter.present(result2, type="bar", ...)
chart3 = presenter.present(result3, type="line", ...)

I would prefer presenter to return an object that can be JSON-ified (not JSON string), so you can request multiple presentations with one request (for example, for whole report page).

What do you think?

Member

Stiivi commented Sep 7, 2012

@ovnicraft - you are right. chart should in fact be flotr2 representation of a chart (data structure that you directly pass to flotr2 libs). For example, *Presenter objects for JS charts should return objects that can be used by JS libraries, if the lib expects JSON, then it should be JSON. The two steps you mentioned have a reason:

presenter = cubes.presenter("flotr2", options ...)
chart1 = presenter.present(result1, type="pie", ...)
chart2 = presenter.present(result2, type="bar", ...)
chart3 = presenter.present(result3, type="line", ...)

I would prefer presenter to return an object that can be JSON-ified (not JSON string), so you can request multiple presentations with one request (for example, for whole report page).

What do you think?

Stiivi added a commit that referenced this issue Oct 17, 2012

implemented simple data table and simple html table presenters; added…
… presenter registration and discovery; include templates in installation; partially implements #53
@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi Oct 17, 2012

Member

Used cubes.create_presenter() instead of just cubes.presenter() to denote that new instance of presenter is created instead of reusing and reconfiguring existing one.

Member

Stiivi commented Oct 17, 2012

Used cubes.create_presenter() instead of just cubes.presenter() to denote that new instance of presenter is created instead of reusing and reconfiguring existing one.

@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi Oct 30, 2012

Member

Another interesting JS charting library: Rickshaw

Member

Stiivi commented Oct 30, 2012

Another interesting JS charting library: Rickshaw

@ovnicraft

This comment has been minimized.

Show comment
Hide comment
@ovnicraft

ovnicraft Oct 30, 2012

I am agree with you about JSON-fied object, so Presenter class must be implement a json method to return ?

I am agree with you about JSON-fied object, so Presenter class must be implement a json method to return ?

@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi Oct 30, 2012

Member

It does not have to (see "text_table" presenter), but for most use cases it is going to be implemented as JSON. Result object should be displayed by caller by no minimal transformation effort at all, or just very minimal.

Member

Stiivi commented Oct 30, 2012

It does not have to (see "text_table" presenter), but for most use cases it is going to be implemented as JSON. Result object should be displayed by caller by no minimal transformation effort at all, or just very minimal.

@Stiivi

This comment has been minimized.

Show comment
Hide comment
@Stiivi

Stiivi Nov 20, 2012

Member

Another lib: nvd3

Member

Stiivi commented Nov 20, 2012

Another lib: nvd3

deytao added a commit to deytao/cubes that referenced this issue Dec 3, 2012

implemented simple data table and simple html table presenters; added…
… presenter registration and discovery; include templates in installation; partially implements #53
@claudiobertoldi

This comment has been minimized.

Show comment
Hide comment

code6 pushed a commit to code6/cubes that referenced this issue Mar 13, 2014

implemented simple data table and simple html table presenters; added…
… presenter registration and discovery; include templates in installation; partially implements #53

code6 pushed a commit to code6/cubes that referenced this issue Mar 13, 2014

implemented simple data table and simple html table presenters; added…
… presenter registration and discovery; include templates in installation; partially implements #53

@Stiivi Stiivi added wish and removed enhancement labels Jun 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment