Creates a js library based on d3.js which will manage charts in Horizon

Registered by Maxime Vidori

Soon Ceilometer will be integrated into Horizon, this feature will include a lot of charts. With a charts js library the code will be aggregated and the developer don't have to hardcode features on d3. This library will support csv and json data, ajax updating, multi charts in one svg, appearance based on Horizon design and colors, ...

Blueprint information

Status:
Complete
Approver:
David Lyle
Priority:
Medium
Drafter:
Maxime Vidori
Direction:
Approved
Assignee:
Maxime Vidori
Definition:
Approved
Series goal:
Accepted for havana
Implementation:
Implemented
Milestone target:
milestone icon 2013.2
Started by
Gabriel Hurley
Completed by
David Lyle

Related branches

Sprints

Whiteboard

[lsmola] Is it worth to think about using some existing library based on d3? Or rather to create a new one?
There are eg. NVD3 and rickshaw, that seems to be usable. And I guess if we will want a charts with pretty effects, that could take some time to implement it.

Also we have already started to write some general javascript control wrappers( a general concept of basic commands for controlling a chart via ajax, like changing time spans, type of data, etc.) for basic types of charts ( bar, line, health chart ) in tuskar-ui, it now uses pure d3 for rendering, but it shouldn't be problem to switch the rendering.

That could be a kick-start I guess, so this doesn't have start from scratch.

[mvidori] I looked at those libraries based on d3, NVD3 is a shinny one but pretty messy 13K+ code lines, difficult to extend. I think rackshaw is a good choice, the code is clear, the features are great. Maybe we can make a Horizon script in top of it to make the chart creation easier and quicker.

[rob-raymond] We have been using Rickshaw as a wrapper for D3 in Horizon and have been happy with it. It does have limited functionality right now... no pie chart for example

[lsmola | 23.8.2013] mvidori could you put this on a vote to the mailing list? I will be adding some line chart probably next week (with ceilometer). I could actually try it. Or we can switch the rendering library later.
About the pie charts, I'am not sure whether it is a big issue. We could find some mini library for
pie,bar charts, or just create some.
Rickshaw looks pretty good for time-series charts. I haven't really tried any of them. Co-worker tried
NVD3 and didn't like it, mostly because of the lack of documentation.

[hayashi]
Choosing between NVD3 and rackshaw, I prefer rackshaw. I used it other project, The API is clean and easy to understand, It worked well.
Also I found another library Radian. It's based on AngularJS + D3.js.
http://openbrainsrc.github.io/Radian/index.html
It uses custom html tags (powered by Angular.js) instead of JavaScript, The code would be more simple and clean compared to other libraries. I haven't tried it so much yet, but I think it is worth a try.
It seems they have updated actively.
https://github.com/openbrainsrc/Radian

[lsmola | 27.08.2013]
Hayashi I think that adding a proper client side layer ( like angular ), is one of the long term goals. ( there is a blueprint for proper AJAX interface, that is connected to this ) So I would rather go with Rickshaw for now.

[mvidori]
I have made a quick wrapper for rickshaw which provides an automatic creation for basic charts. Code is available at : https://github.com/IxDay/horizon_chart If someone can take a look and make some feedback.

[lsmola | 27.08.2013]

I have prepared the testing implementation of Rickshaw wrapped into a general linechart and connected it to Ceilometer here:
https://review.openstack.org/#/c/35590/
(rendering is mostly copied from examples with some parts from Maxime Vidori)

The example shows statistics of Nova Instances, though the data needs to be formatted, it doesn't make much sense now. :-)

I will extract the parts and push the commits here. So we can start work on this. (there is a lot of FIXMEs and TODOs in linechart library, also other types of charts should be added)

Gerrit topic: https://review.openstack.org/#q,topic:bp/admin-resource-usage-page,n,z

Addressed by: https://review.openstack.org/43880
    Adding Rickshaw as dependency

Addressed by: https://review.openstack.org/43881
    Adding reusable Line Chart

[hayashi]
Ismola, that make sense, I got it.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.