Graphs in Django-Big Data analytics - javascript

Well my question is I want to build a running graph with random inputs,lets say in the range of 1-1000. The graph is kind of like a graph drawn by an ECG, an instrument which records the the heart beats and outputs the result on the screen in the form of a graph. The random values should be generated after a particular time-interval,say 5 secs. Upon arrival of new randomly generated value, the graph should shift left and the new value should be represented on the graph, just like this ECG. Visit the link.
And to give a more broad and practical view, I am developing a system for Data Analytics where the Data will be analyzed and the results(in the form of graphs) will be shown in the frontend.
A friend of mine, who is good with javascript suggested me that this could be done with js. But, I want it to be done using MVC architecture. So , how would I approach this problem. Preferably how can I model this in Django.
Different suggestions are always welcomed.

May be its a little late.
Try http://www.highcharts.com/demo/dynamic-update. This will surely help you.

Related

Javascript framework suggestion for displaying dynamic data

To give a background of what the user interface for the application I am creating does:
I am designing a sort of dashboard for a list of people who clocked into work on a particular day. The basic design is the names of people will be on slices of a donut chart, when they clock into work on a day, their slice color will change from red to green indicating that they are in work today. The user of the dashboard will also be able to click or hover over one of the slices to have it expand and show more detailed information about the person (more text).
I have the back-end of my sample application ready to serve data to be displayed by a UI, but I am not sure how I should go about designing this. What I am asking is if there are any JavaScript frameworks that would make this easy to implemented. I already looked at a bunch of tools such as Google Charts, ,ChartJS, and D3.js, but that seems more focuses on displaying actual numerical data rather than textual which is what I am going for.
Any suggestion into frameworks or technologies would be appreciated, thank you.
You could consider using Raphael as charting library.
While D3 is much more powerfull, it comes with a a bit steeper learning curve. IMO using Raphael will get you quickly started.
I hope it helps

Google Charts + Google Sheets: Specified range does not identify data correctly

I settled on using Google Charts to draw the data from an auto-updating Google Sheet that draws from my Analytics account (the analytic API wasn't working out).
I've done quite a lot of reading, but I'm finding the query language reference to be a pain.
I've chosen to use the ChartWrapper.
https://jsfiddle.net/7xzv59kj/2/
// Visits
var wrap = new google.visualization.ChartWrapper();
wrap.setChartType('ColumnChart');
wrap.setDataSourceUrl('https://docs.google.com/spreadsheets/d/1jICOBDvZzRxEThcWqnpFmNLUqjVP81Zd9RTwpbG29cE/gviz/tq?sheet=Sheet2&range=Keywords-All_Time!B11:C12&headers=1&tq=');
wrap.setContainerId('visits-all-time');
wrap.draw();
}
I want the chart to display the labels for Users and Sessions on the H-Axis, and then the values on the V-Axis. Instead, the data gets all jumbled and confused. I don't know what parameters to specify and how to label them properly.
Spreadsheet located here.
https://docs.google.com/spreadsheets/d/1jICOBDvZzRxEThcWqnpFmNLUqjVP81Zd9RTwpbG29cE
I would like to draw the data from the sheet titled Keywords-All_Time from range B11:C12
The issue here was just my foggy brain - I took a break and came back to it yesterday to discover a couple issues:
wrap.setDataSourceUrl('https://docs.google.com/spreadsheets/d/1jICOBDvZzRxEThcWqnpFmNLUqjVP81Zd9RTwpbG29cE/gviz/tq?sheet=Sheet2&range=Keywords-All_Time!B11:C12&headers=1&tq=');
My URL specifies the sheet twice. I recall someone telling me to format the range with the sheet, but I suppose I never erased the other parameter.
My table had the axes the wrong way around. I reversed them and found everything worked well from there.
I abandoned the chart wrapper and decided to move on to that when I actually have a need for it. Here's the current jsfiddle with the code I'm working on now: https://jsfiddle.net/c11c9a0w/19/
This will be extremely helpful for anyone having trouble building a dynamic dashboard from a Google Sheet that has multiple graphs on a single page, so feel free to work off of this.
-Joel

What's the best UI framework to annotate data points / data series?

Recently I got a requirement where
I have a certain amount of time series data, I need to show the data on a chart on a web page.
(I know this can be done easily since there is Highcharts, Google charts, etc)
However, a more complicated feature request came up. I need to be able to annotate one or more data points on the chart, and annotate them as - say Test Run 1, and maybe another series of data points at Test Run 2. (You can think of it as maybe someone is playing around with a hardware, the first time he collected a set of data, and the second time he collected another a set of data. I want to be able to annotate and diffenrentiate those data sets on the chart)
I will need to preserve those segmentations/groupings and save them in a persistent store, so that next time I load the chart, I can show those grouping again on the chart.
Does anyone know what is the best way to do this? Or are there existing features of any Javascript UI framework that's already capable of doing it?
Thanks so much.

Need advice on a database structure

A friend and I put together a MySQL php website where users can make predictions on sports events.
My question is regarding our "rankings" page which displays the list of members who have made the best predictions. The way we had it initially was each time a user loaded that page the server would calculate all the predictions from all the users, then displayed the top ones. Unfortunately, even with a small group alpha testing it, the loading of this page quickly became slower as the number of predictions grew.
Ideally speaking, we would like to have filters on this page, for each different sport, league and time frames, and create a dynamic rankings page, but we're stuck on finding an efficient way to structure our database that won't use up too much server resources.
Any ideas on what a better way could be is greatly appreciate. Thanks!
You could use "materialized views" to calculate the score. A materialized view is a view (thus some query), but where the results are stored (in memory) and updated accordingly:
http://www.fromdual.com/mysql-materialized-views
One can expect that the difference (in the number of (correct) predictions) will not change dramatically between two page renderings. Thus that the number of calculations will be quite low.

Best method to create large graph that can be panned and scaled with HTML 5

I have a request form a client and am looking for advice on the best procedure. I believe that HTML 5 can help however I'm not too experience in the more advanced features of HTML 5 to come to a conclusion.
Basically my client is looking to have a universe which in effect really is just a large graph. Plotted within the universe are elements that are added by users. This amount will increase over time. Hence the graph will increase in dimensions. The idea is to see the universe as a whole with small dots representing elements. Then a user can zoom in and/or pan the universe to discover different elements. Clicking an element bring up a dialog and more information can be gained. Zooming can happen in real time or is it acceptable to click a region and it gets bigger.
My assumption is that the best way to go about this is to use HTML 5 and Javascript. However as stated I'm new to HTML 5 and its limitations.
It would be nice if it could be light-weight and accessible on multiple devices (mobile, tables, etc).
Is HTML the solution here? What would be the best practice? Any suggestions?
A while back I built something very similar by integrating with Google Maps. I pulled addresses from my database, converted using a Geocode tool, then with PHP/Javascript combination I input the data into Google Maps (just using a simple foreach loop) and stuck the code on my site. In all, it was pretty simple since Google handles most the application.
The hardest part, IMO, was validating the addresses and converting them to Geocode.
If you want to take this route, here are some helpful links:
GOOGLE MAPS INTEGRATION DOCUMENTATION (pretty much contains everything you'll need to know)
https://developers.google.com/maps/documentation/javascript/
GEOCODING WITH GOOGLE (Limits you to 2500 hits per day)
https://developers.google.com/maps/documentation/geocoding/
And the rest I'd search here in stackoverflow.
Hopefully this helps point you in the right direction.

Categories