Re: Applying data from a database link to a GraphPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg131138] Re: Applying data from a database link to a GraphPlot
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Fri, 14 Jun 2013 04:58:35 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20130613063835.7C7166A65@smc.vnet.net>
data = {{"PENELOPE", "GUINESS"}, {"NICK", "WAHLBERG"}, {"ED", "CHASE"}, {"JENNIFER", "DAVIS"}, {"JOHNNY", "LOLLOBRIGIDA"}, {"BETTE", "NICHOLSON"}, {"GRACE", "MOSTEL"}, {"MATTHEW", "JOHANSSON"}, {"JOE", "SWANK"}, {"CHRISTIAN", "GABLE"}}; GraphPlot[Rule @@@ data, VertexLabeling -> All] Bob Hanlon On Thu, Jun 13, 2013 at 2:38 AM, Paul Pikowsky <ppksky at gmail.com> wrote: > This is my first project and I am trying to import data from a MySQL query > into a GraphPlot expression. > > A return from MySQL (Sakila is the example here) > > SQLExecute[conn, "SELECT first_name, last_name FROM actor LIMIT 10"] > > {{"PENELOPE", "GUINESS"}, {"NICK", "WAHLBERG"}, {"ED", > "CHASE"}, {"JENNIFER", "DAVIS"}, {"JOHNNY", > "LOLLOBRIGIDA"}, {"BETTE", "NICHOLSON"}, {"GRACE", > "MOSTEL"}, {"MATTHEW", "JOHANSSON"}, {"JOE", "SWANK"}, {"CHRISTIAN", > "GABLE"}} > > (This is not the intended data, just a sample of the output.) > > But GraphPlot uses inputs of the form, > > GraphPlot[{"d" -> "c", "e" -> "b", "e" -> "c", "e" -> "d", "f" -> "a", > "f" -> "b", "f" -> "d", "f" -> "e", "g" -> "a", "g" -> "b", > "g" -> "c", "g" -> "e"}, VertexLabeling -> True] > > Is there some way in place of converting the output of a data query to the > input of a graphplot? I see that an adjacency matrix is an optional input, > but I'd also want to use labels generated from the database. > >
- References:
- Applying data from a database link to a GraphPlot
- From: Paul Pikowsky <ppksky@gmail.com>
- Applying data from a database link to a GraphPlot