|
from typing import List
|
|
from quickchart import QuickChart
|
|
|
|
def chart_generation_func(queries: List[str], session_hash):
|
|
print("CHART GENERATION")
|
|
query_dict = queries[0]
|
|
print(query_dict)
|
|
|
|
qc = QuickChart()
|
|
qc.width = 1000
|
|
qc.height = 500
|
|
|
|
|
|
qc.config = query_dict
|
|
|
|
url_id = qc.get_short_url().rsplit('/', 1)[-1]
|
|
url_base = qc.get_url_base()
|
|
|
|
interactive_url = url_base + '/chart-maker/view/' + url_id
|
|
|
|
iframe = '<div style=overflow:auto;><iframe\n scrolling="yes"\n width="1000px"\n height="500px"\n src="' + interactive_url + '"\n frameborder="0"\n allowfullscreen\n></iframe>\n</div>'
|
|
|
|
return {"reply": iframe}
|
|
|