bash-history-punchcard
bash-history-punchcard copied to clipboard
Google Image Graphing is deprecated; getting killed in 2015
As per https://developers.google.com/chart/image/, Google is killing the service and making pygoogle useless?
For this libraries purposes, I need to figure out another API to render punchcard PNGs.
I am currently experimenting with using Highchart.js to render the punchcard graph in a browser canvas window http://jsfiddle.net/CA2cT/64/ and then render it out to a PNG using phantom.js https://github.com/vgnett/highcharts-png-renderer This could be extended to an API you could run on heroku.
Anyone else have ideas?
Also this page has google sample code for highcharts.js but it looks like its for an older version of highcharts (2?) http://blog.webasp.com.au/post/625620936/how-to-make-scatter-chart-like-github-punch-card
I was thinking to create an issue like this, but it's title was "HTML output."
Why that, because to continue bash-history-punchcard, I think using an HTML template which utilizes the Google's newer charting API. We export the data as in JavaScript code, they should be just a format of array.
The main code for charting is JavaScript. Now come to think it, we could just use File API and load the Bash history file directly in web browser.
Of course, there will not be a direct image output method.
just some additional thoughts, If we are going to use hybrid method, we might as well as transform into pure HTML/JavaScript code.
But I do remember I have read some code somewhere which uses PIL and/or Qt to generate punchcard of Hg commit history when I tried to search for a graphing library for punchcard, if I recall correctly. Unfortunately, I didn't save the link.
I'd like the second approach for continuation of this project, keep it in Python and doesn't have weird dependency.
After looking at Google's newer charting API, I am not impressed. The Google Image API is simpler and more flexible. I've been able to get something like this rendering, but cannot adjust the labels on the x/y axis: http://savedbythegoog.appspot.com/?id=8d019ab9e25685c448887b2a7e7229ae74e3d672
I think it would be great to get an graph rendering solution in Python, but my thoughts toward doing something in JS is because Highcharts seems like a great and flexible graphing solution and could be an easy external REST API, similar to how pygooglechart works now.
For Python solutions, pygal seems like an ok SVG rendering solution (but then you need an SVG to PNG renderer...) http://pygal.org/chart_types/#dot-charts matplotlib is probably the best choice, http://matplotlib.org/users/screenshots.html#scatter-demo but I feel like it's a heavy library that isn't easy to install because of compiled C parts. Perhaps it would be best to try matplotlib and then setup a REST API around matplotlib. I will look into that tonight
matplotlib seems good enough. I found the hgpunchcard renderer which uses it https://bitbucket.org/birkenfeld/hgpunchcard Update a bunch of that code and added a matplotlib.py to this repo.
After tonight, I'm thinking more toward trying to create a 'pypunchcard' library that renders the best punchcard graph out there and then having bashpunchcard depend on that. I'm kind of curious now to play month/year level punchcard rendering and adding heatmap values. Matplotlib has that kind of flexibility.
I like the idea of having a library solely for generating punchcard graph, but why not just call it "punchcard?" there seems no packages named by that on PyPI. By the way, there is also a "punchcard.py," perhaps joint force is better, for ideas, thoughts, and coders? Or maybe you should create a new repo now instead of committing testing code to this repo?
Anyway, the rendered image from 3fea70e looks quite similar to current one, that definitely a good reason to use it.