from plotly.subplots import make_subplots
import plotly.graph_objects as go
import plotly.io as pio
from dataProcessor import parseLabels, parseLangs
import plotly.io as pio
import os 

years = parseLabels()
langs = parseLangs()

#make the plotly results

fig = make_subplots(
    rows=1, cols=2,
    specs=[[{"type": "xy"}, {"type": "domain"}]],
)

fig.add_trace(go.Bar(y = list(langs.values()), x = list(langs.keys()), showlegend=False),
              row=1, col=1)


fig.add_trace(go.Pie(values = list(years.values()), labels = list(years.keys())),
              row=1, col=2)


fig.update_layout(height=600)

pio.write_html(fig, 'index.html', auto_open=True)


[((8, 8, 8, 21), 'dataProcessor.parseLabels', 'parseLabels', ({}, {}), '()', False, 'from dataProcessor import parseLabels, parseLangs\n'), ((9, 8, 9, 20), 'dataProcessor.parseLangs', 'parseLangs', ({}, {}), '()', False, 'from dataProcessor import parseLabels, parseLangs\n'), ((13, 6, 16, 1), 'plotly.subplots.make_subplots', 'make_subplots', (), '', False, 'from plotly.subplots import make_subplots\n'), ((28, 0, 28, 49), 'plotly.io.write_html', 'pio.write_html', (), '', True, 'import plotly.io as pio\n')]