Anania Docs
  • Introduction
  • ❓ FAQ
  • 📙 Resources
  • 📢 For Public Relations
  • 👨‍💻 For Developers
    • 👾API Documentation
    • 🐍Python Client
    • 📈Rendering Charts
  • 🤝 For Investors
Powered by GitBook
On this page
  1. 👨‍💻 For Developers

Rendering Charts

PreviousPython ClientNext🤝 For Investors

Last updated 3 years ago

Whenever applicable, the Question endpoint will provide an additional JSON plot object following the Plotly JSON chart schema. In order to render the plots in the Frontend, one needs to use a Plotly client and simply render the plots form the JSON object.

Plotly clients are including which can be used with various JS frameworks.

Below is a ReactJS snippet that defines a small function, which allows rendering the plots from the response received from the Anania's question API endpoint.

import Plot from 'react-plotly.js';

const get_chart = (res) => {
    const chart_data = res['Output chart']

    return <Plot 
      data={chart_data['data']}
      layout={chart_data['layout']}
    />
  }
📈
available in several languages
Plotly.JS