Coder Social home page Coder Social logo

Graphing documentation? about articles HOT 5 CLOSED

wichtounet avatar wichtounet commented on July 23, 2024
Graphing documentation?

from articles.

Comments (5)

wichtounet avatar wichtounet commented on July 23, 2024

If you look at the code, you'll notice the output:

graphs::output(graphs::Output::GOOGLE);

It outputs graphs in HTML format using the Google Graph API. By calling the function of graphs.hpp, the results are stored and then output when graphs::output is used.

Normally that should be enough.

from articles.

BenFrantzDale avatar BenFrantzDale commented on July 23, 2024

Thanks. I've never used that API. After some poking around, I found I had to add the following around the contents of graph.html (diff below). Am I missing something or is there an automatic way to go from graph.html to a viewable html page?

$ diff graph.html my_graphs.html 
1c1,9
< <script type="text/javascript">
---
> <html>
>   <head>
>     <!--Load the AJAX API-->
> 
> 
>     <script type="text/javascript" src="https://www.google.com/jsapi"></script><script type="text/javascript">
>   google.load('visualization', '1.0', {'packages':['corechart']});
>   google.setOnLoadCallback(draw_all);
> 
585a594,595
>   </head>
> <body>
626a637,639
> 
>   </body>
> </html>`

from articles.

wichtounet avatar wichtounet commented on July 23, 2024

You're right, the Google Visualization API has to be loaded before, that is missing on the generator. I fixed it in 3b4868d

from articles.

BenFrantzDale avatar BenFrantzDale commented on July 23, 2024

Thanks. A usage comment in the README wouldn't hurt, but with this change I would have figured it out without any googling.

from articles.

wichtounet avatar wichtounet commented on July 23, 2024

You're right. But I never thought of this as a usable API. The next time I add some code in this repository for an article, I will try to clean it all.

from articles.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.