What geo chart library NyTimes is using? - d3.js

I found this link
http://www.nytimes.com/interactive/2015/07/24/business/international/the-world-according-to-china-investment-maps.html?_r=1
It is also interactive.
Can I know what lib they are using?

Looking at the Javascript assets, it looks like it's loading d3.js and topojson. The map itself is an SVG, so likely generated using D3.

this page use one js file for draw chart : chartbeat.js
download chartbear.js

Related

Chart from d3.js to file without displaying on a page first

I am new to d3 but I am hoping that it possible to create a chart in d3 and output the chart to a file without displaying it on a page first. Is it? I would like to include various charts in a pdf document using fpdf and import into the pdf a chart or two.
I have been searching around for a solution to this for some time now. While I can see that you can:
Use d3 (chart.js etc) to generate a chart and display it on screen in a page
Export the image to file on the server
And then create the pdf importing the saved image
But I want to avoid any on screen display and for the image of the chart to be saved to the server directly so that fpdf can import it in.
This seems to me something that would be required frequently but I can't seem to find a solution.
An option seems to be to use something like phantomjs as an interim step but I think that this needs to be running on my host. It would be great if it could be exported to file driectly from d3. Is this possible?

Is there any method to save leaflet map image as vector image (i.e. SVG)?

I am working with web-application which uses OSM and leaflet.
I want to save map image with markers, icons, polylines, polygons and other objects to vector image(SVG/ XML with SVG etc.)
I found leaflet-image but not sure it`s suitable for me.
I also use ExtJs and python as server language.
Any suggestions?
There are two official plugins for exporting/printing Leaflet maps.
Leaflet.print uses a Mapfish or GeoServer print module. Mapfish is built on Python so that could probably work for you. (For completeness - Geoserver is built on Java).
Leafet-image doesn't use any server side tech at all. Just Canvas and CORS.
You won't be able to save the tiles as vector as those are served to you as PNGs. You could recreate it using standard OSM data and a tileserver though. Both plugins will take the tiles and export them as images.

What type of chart or canvas using they are?

http://www.evolutionoftheweb.com/
Question is:
What type of chart plugin they used in JavaScript like jqplot, float plugin?
If not, then how did they make it? is it just image or canvas?
If you look at the page source you will find that all the logic is in the /js/all.js file. If you search this you can find things like: jquery, d3, and other libraries. It seems that majority of work is done with d3.

Interactive Heatmap / Matrix Visualization

I would like to display on a webpage a heatmap (matrix) that I generate in R.
The matrix I have looks like this, but in my case the size is 300x300.
Basically I am looking for an interactive clustering, which would look like this :
http://online.wsj.com/article/SB125993225142676615.html#articleTabs%3Dinteractive
http://mbostock.github.com/protovis/ex/matrix.html
I would like to be able to clic on a branch which would then highlight the selected group/text, and fade out the rest of the matrix.
I have had a look around and cannot find much. I don't even know what language I should use for this ? JSON, Flash, HTML5, javascript, google charts ?
Any comments and advices would be extremely appreciated here.
Thanks.
I think that InCHlib - Interactive Cluster Heatmap library could be the solution.
Available from http://openscreen.cz/software/inchlib.
Google Visualization provides this heatmap option:
http://informatics.systemsbiology.net/visualizations/heatmap/bioheatmap.html
There's also this project that adapted it for more advanced uses and actually includes mouse-overs and tool-tips, as well as line magnification:
http://code.google.com/p/visquick/
You may also want to take a look at jQuery Flot, but be warned that WSJ uses a super expensive company called Tableau for data visualization and you are unlikely to find that level of visualization eye candy in an open source or free to use package.
Unfortunately, I had the same requirement. To create a Clustergram (Heatmap + Dendrogram) for a hierarchical clustering results.
There is no direct solution for this. I used ProtovisGWT (Choosel) to create dendrogram and heatmap seperatley and later combnied them.
If you just want js library you can use just protovis or d3.js to achieve this.
I would recommend using JavaScript for this task. Save your heatmap as SVG in R
svg("mymap.svg")
heatmap(...)
dev.off()
And then embed it into an HTML document as object
<object id="test-svg" width="800" height="600"
type="image/svg+xml" data="test.svg"></object>
Now, you can use JavaScript or ECMAScript to do all kinds of manipulations. I recommend to read one of the various online tutorials on this topic. E.g., you could get started with this one: http://www.petercollingridge.co.uk/data-visualisation/using-javascript-control-svg
Treemap of D3.js solves this beautifully. See here
http://mbostock.github.io/d3/talk/20111018/treemap.html
You could try http://amp.pharm.mssm.edu/clustergrammer/ . It is not written in R, but you can make an interactive clustergram by uploading a matrix file in tab-separated format and you will be returned an interactive (reorderable, searchable, filterable, etc) and shareable web-based visualization
D3heatmap provides interactive heatmaps with dendrograms in R based on the heatmap and heatmap.2 interfaces. It includes single row and column selection but does not currently allow selection of dendrogram branches.

Is there a jQuery plugin for Dot language file visualization?

Is there a jQuery plugin for displaying Dot files live in the browser as specified here?
I've seen a proof of concept at Visual Politics, but it doesn't seem to fully support the Dot language as even -- doesn't display correctly.
Any libraries out there I could have a look at for this?
I need to implement network graphs in the browser from dot files loaded via Ajax (rather than server side generated PNGs)
Check out Canviz: http://code.google.com/p/canviz/
Demos are located here: http://www.ryandesign.com/canviz/
As I was looking for the same answer, I found "viz.js" providing a java script version of GraphViz for DOT (see https://github.com/mdaines/viz.js).
Using this, I build myself WP GraphViz, a plugin for WordPress (see http://wordpress.org/plugins/wp-graphviz/).
I've been working on this for almost a week.
There are three different implementations:
1.Render svg in simple js, no needs install of graphviz
jquery.graphviz.svg https://github.com/mountainstorm/jquery.graphviz.svg
jQuery plugin to make Graphviz SVG output more interactive and easier to navigate. Makes it easy to have features like:
Highlight nodes/edges
Zoom in/out
Graph navigation - select linked nodes
Fancy UI tooltips; bootstrap supported out the box
Move things forward/back in the graph
Have a look at the demo: https://cdn.rawgit.com/mountainstorm/jquery.graphviz.svg/master/demo.html
2.Based on d3.js
<https://github.com/dagrejs/dagre-d3> d3.js + dagre
<https://github.com/dagrejs/dagre> pure js library
or:
<https://github.com/magjac/d3-graphviz> d3.js + graphviz c++ build
<https://github.com/hpcc-systems/hpcc-js-wasm> build graphviz 2.47
3.server side call graphviz to generate svg file.
<http://viz-js.com/>
<https://github.com/mdaines/viz.js>
<https://github.com/dreampuf/GraphvizOnline>

Resources