couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Nicollet <vnicol...@runorg.com>
Subject Re: How do I add an external JS library to CouchDB?
Date Mon, 29 Aug 2011 22:27:01 GMT
Hello Fred,

Dygraph is intended to be run inside a browser, you cannot use it to graph
data in a CouchDB list function. What you should do is have the list
function output the data in a format that Dygraph can use in the browser.
For instance, you could have your list function return CSV data, and provide
Dygraph with the URL of the list.

-- VN

On 29 August 2011 23:51, Fred Smith <thefredsmith@gmail.com> wrote:

> Hi,
>
> I am trying to add the dygraph js library to CouchDB, so I can graph
> data in a list function.
> I have downloaded the library, but I don't know where it should go. When
> I try create a 'new Dygraph' I get:
> error":"render_error","reason":"function raised error: (new
> ReferenceError(\"Dygraph is not defined\ ...."
>
> I feel this is a dumb question, but how do I add an external JS library
> to CouchDB?
>
> Thanks for the help,
> Fred
>
> This is a sample from dygraph that won't work.
>
> <html>
> <head>
> <script type="text/javascript"
>  src="dygraph-combined.js"></script>
> </head>
> <body>
> <div id="graphdiv"></div>
> <script type="text/javascript">
>  g = new Dygraph(
>
>    // containing div
>    document.getElementById("graphdiv"),
>
>    // CSV or path to a CSV file.
>    "Date,Temperature\n" +
>    "2008-05-07,75\n" +
>    "2008-05-08,70\n" +
>    "2008-05-09,80\n"
>  );
> </script>
> </body>
> </html>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message