Susi got few capabilities to visualize it’s response. She can respond by sharing links, showing analytics on pie charts and give you a list of bulleted data. So this post shows you on how these components are integrated into Susi.
The rules which are defined can give data in various compatible forms. It can give links, share some analytics in the form of percentages and certain list of data. For example, in the previous blog post on adding susi rules, we added a sample rule showing on how to add types of responses to susi. If you want more context on it, you can click here.
- Susi taking responses from data: This type of response is in the form of a table. Susi can take the extra data under the data.answers.data , where the type if of table. The below is a sample JSON format from which the tabular data can be parsed.
From the above JSON the data under the answers object is being traced for the tabulated answers. This expression will get you the titles of the reddit articles.
The above response is for the following query
This is Susi’s response on asksusi.
- Susi answering using piecharts: Susi rules can also be defined in such a way that the response can give out a well formed pie chart. The data required for the piechart is defined and this can easily be interpreted using highcharts for giving a clear pie chart response. Here is sample JSON response for the following query.
The above JSON defines data for piecharts giving percentage and relevant name for that particular object. This is easy to interpret the json for defining the piecharts using highchart.js . The below is the sample code which was used to define the piecharts.
This is how the interface answers with piecharts.
- So susi can also interpret links from the response and linkify them accordingly.
Here is the sample code on how Susi interprets the links from the response.
The links are linkified and this how Susi responses.
Stay tuned for more updates on Susi.