ghstats.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:foss-heartbeat 作者: sagesharp 项目源码 文件源码
def graphRampTime(deltas, nocontribs, graphtitle, xtitle, filename):
    data = [Histogram(x=deltas)]
    layout = Layout(
        title=graphtitle,
        yaxis=dict(title='Number of contributors'),
        xaxis=dict(title= xtitle +
                   '<br>Mean: ' + '{:.2f}'.format(statistics.mean(deltas)) + ' days, ' +
                   'Median: ' + '{:.2f}'.format(statistics.median(deltas)) + ' days' +
                   '<br>Number of contributors who did this: ' +
                   '{:,g}'.format(len(deltas)) +
                   '<br>Percentage of contributors who did this: ' +
                   '{:.2f}'.format(len(deltas)/(len(deltas)+len(nocontribs))*100) + '%')
    )
    fig = Figure(data=data, layout=layout)
    return offline.plot(fig, show_link=False, include_plotlyjs=False, output_type='div')

# FIXME Maybe look for the word 'bot' in the user description?
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号