using d3, redraw the graph based on node click - json

I am using a d3 force-directed graph that produces a hairball of data. :-)
I think it's either this one: http://bl.ocks.org/1138500 or this one: http://bl.ocks.org/4062045
(I inherited this so not exactly sure but these 2 visualizations are really similar!)
When I click a node, I'd like to zoom in on, or redraw the graph based on just that node. So on click of a node, the other nodes and edges would disappear. How can I do that? I'm using Ruby on Rails and Neo4j, so a cypher query is creating the JSON data that d3 uses.
Will i have to re-query the database via cypher? I hope not. I'm hoping that this can be done in d3.js alone.
Thanks in advance for your ideas. If you have a working example, I'd love to see it!

Probably you need to ask on the D3 mailing list.

Related

feathers.js subscription behavior on patch/update

I am currently playing around with feathers to see if its a good replacement for meteor.js in our POS back-office application.
It looks really great so far but i cam up with a thing i could not solve.
Sometimes i miss a simple thing if i do not find something on the net but I hope someone can help me to figure out:
The problem:
I am using feathers client and a observable client side to populate a data-grid with documents from the mongoose/mongodb based service. It works fine beside I make an UPDATE/PATCH on ANY of the documents contained in the "table".
That moment all (filtered) find results are replaced by just this updated document.
I know that i could cache the results in an array and then use the respective events to update the array, but i wonder if there is an easier way (as in meteor) that the find result remains intact and if it contains the updated document that is simply updated.
Any help appreciated
Greets from Manila
Ralph
How to keep the data up to date depends much on the frontend framework you are using.
The most framework agnostic solution is feathers-reactive which uses RxJS and works well with React (see this video) and Angular 2+
feathers-vuex for VueJS
can-connect-feathers for CanJS
For everything else you can keep the data up to date manually through the real-time events as you already mentioned.

Is it possible to embed [bokeh] high level charts?

It seems most Bokeh embedding examples are using bokeh.plotting.figure object. Is it possible to embed a high level chart, like bokeh.charts.Bar or bokeh.charts.Scatter? Or is it possible to have convert a high level chart to a bokeh.plotting.figure object?
Thanks a lot.
The User's Guide section on Bokeh APIs has a good run down of how all these parts fit together, that I would suggest reading.
The long-story-short: Regardless of what API you use, bokeh.plotting or bokeh.charts, the end result is always just a collection of the same low-level bokeh.models objects. You can can think of bokeh.models as very basic building blocks, and the other higher level APIs as conveniences that help you to assemble the building blocks more efficiently and correctly.
So, in that light, yes, it is perfectly fine to embed a bokeh.chart using exactly the same functions described in Embedding Plots and Apps.
The one thing I will add is that if you need to update the plot's data after the fact, in place, then the bokeh.figure API will probably be more straightforward. The mapping between your data, and what gets plotted is more direct. Things generated by bokeh.charts may transform your input data into entirely different forms before plotting (e.g. you give a series, and Histogram has to spit out coordinates for boxes—not the data you started with)

Program to graph MySQL data

I have a fairly simple mysql database. I want to extract data from it and display as a graph to analyze it. Nothing advanced, just line diagrams and such. As a programmer I can always write some code for this myself. But does anybody know of a program that can load data (using sql queries?) and display it in various graphs?
Checkout DBPlot for Windows environment.
You can also have a look at Google Charts, if you want your graphs displayed in web pages.
Don't know what type of output you're looking for, but FusionCharts has helped me a lot... http://www.fusioncharts.com/free/
You can use GNUPLOT if you are in linux environment. I am currently using this for generating automated EOD reports which contains graphs. The graphs are drawn using the data fetched from mysql (Currently we are using in csv) But gnuplot is not as good as Fusion Chart in UI Perspective
I'd have to recommend JQplot if you want these graphs in web pages - it's non Flash (hooray!), uses JQUery (hooray!) and has some very, very cool features (hooray! - check out the examples page).
As per the docs page, you can just pass an array of values to it and it'll plot what you want, and generating an array is simple in server side languages such as PHP.
Hope this helps,
James
An extremely flexible library for graphs (images and applets) would be JFreeChart.
On the other hand, if what you actually need it is a reporting engine, Jasperreports should be your first and final stop but you will have to do A LOT of reading before starting doing something with the latter and it won't be time lost for nothing.
Try Smart chart maker it is used to create many type of charts that can be fed from a MySQL database . supported chart types include line charts , pie charts, bar charts, and scattered charts.

I want to edit corresponding postgresql data of a vector from openlayers- how to do it?

I want to edit the corresponding text/numeric data type columns of a vector through openlayres, when a user click/mouse over a vector. like,
http://dev4.mapgears.com/bdga/bdgaWFS-T.html#
any tutorial page for how to do it?
I gone through it ,
it was difficult for me to understand from its js codes.
-posted in gis.stackexchange
In the example, OpenLayers is getting data from a WFS server with a Postgres/PostGIS backend.
You could try FeatureServer, but the GIS StackExchange is probably the best place to ask for help on this.

2008 TIGER/Line® Shapefiles from Census.gov -> Google Maps

How do I take shapefiles and extract lat/lng coords so I can plot polygons on Google Maps?
http://www2.census.gov/cgi-bin/shapefiles/national-files
I asked this question here:
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/18763b4b0cb996c7
and they told me WHAT to do, but not HOW to do it =P
Thx!
It depends on how you need to accomplish this. If you just need a few shapes, you can look up the coordinates in those files yourself. You can use those coordinates to create a GPolygon in Google Maps.
If you need lots of shapes - you'll need to do it programmatically. I would suggest using your favorite language to parse the XML file and retrieve the coordinates for each shape.
I had a similar problem last year when I was developing a screensaver to render presidential polling data. I didn't really want to invest the time to parse the Shapefiles data on the census site (The spec is here if you missed it).
Not sure if I actually saved any time here, but I ended writing a python app to render the 50 states onscreen, trace the edges and then store the data in a simple text format. Not sure if my data is high res enough for your application, but you can grab the data I generated here:
http://www.cannonade.net/pnt.zip
N.B. The data I generate are not latitude/longitudes, but with some scaling you should be able to translate them.
Good luck.
I had better luck using the ARC files at http://www.census.gov/geo/www/cob/index.html
I can't find the webpage right now, but I did find one that had actual code. Google something like "arc to kml" and go from there.