예제 #1
0
def mvpCount(filename):
    data = utils.ReadResult(RESULTS_DIR + "/MVPCount.json")
    MVPCountGraph = [
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(v) for v in data.values()],
               name="Unique MVPs")
    ]
    g = utils.BuildPlot("Unique MVPs", filename, MVPCountGraph, "Team Owner",
                        "# of MVPs")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #2
0
def totalBenchPointsScored(filename):
    data = utils.ReadResult(RESULTS_DIR + "/BenchPoints.json")
    benchGraph = [
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(v) for v in data.values()],
               name="Total Bench Points Scored")
    ]
    g = utils.BuildPlot("Total Bench Points Scored", filename, benchGraph,
                        "Team Owner", "Points")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #3
0
def avgMvps(filename):
    data = utils.ReadResult(RESULTS_DIR + "/AvgMVPs.json")

    MostPointsGraph = [
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(v) for v in data.values()],
               name="Average MVPs")
    ]
    g = utils.BuildPlot("Average MVP", filename, MostPointsGraph, "Team Owner",
                        "MVPs")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #4
0
def teamMvpPoints(filename):
    data = utils.ReadResult(RESULTS_DIR + "/playerMostPoints.json")

    MostPointsGraph = [
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(v) for v in data.values()],
               name="MVP by Points")
    ]
    g = utils.BuildPlot("MVP by Points", filename, MostPointsGraph,
                        "Team Owner", "Points")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #5
0
def normalizedMVPs(filename):
    data = utils.ReadResult(RESULTS_DIR + "/NormalizedMVPsPerWin.json")

    NormMVPsGraph = [
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(v) for v in data.values()],
               name="How Hard Was It to Win")
    ]

    g = utils.BuildPlot("How Hard Was It to Win", filename, NormMVPsGraph,
                        "Team Owner", "Difficulty Score")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #6
0
def benchVsWinsGraph(filename):
    data = utils.ReadResult(RESULTS_DIR + "/BenchPoints.json")
    benchVSWinsGraph = [
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(v) for v in data.values()],
               name="Total Bench Points Scored"),
        go.Bar(x=[str(v) for v in data.keys()],
               y=[str(wins.getWins(v)) for v in data.keys()],
               name="Wins*100")
    ]
    g = utils.BuildPlot("Bench Points and Wins", filename, benchVSWinsGraph,
                        "Team Owner", "Points/Wins x 100")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #7
0
def teamPointsPerPosition(filename):
    t = utils.BuildTrace("Team Points Per Position", "Team Owner", "Points")
    for filename in os.listdir(RESULTS_DIR + "/TeamPtsPerPosition/"):
        data = utils.ReadResult(RESULTS_DIR + "/TeamPtsPerPosition/" +
                                filename)
        t.add_trace(
            go.Scatter(x=[str(v) for v in data.keys()],
                       y=[str(v) for v in data.values()],
                       mode='lines+markers',
                       name=filename.replace(".json", "")))
    g = plotly.offline.plot(t,
                            filename="team-pts-per-position.html",
                            output_type='div')
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)
예제 #8
0
def mvpsByWins(filename):
    MVPsByWinsGraph = []
    for filename in os.listdir(RESULTS_DIR + "/TeamMVPByWin/"):
        names = ""
        wins = ""
        data = utils.ReadResult(RESULTS_DIR + "/TeamMVPByWin/" + filename)

        for k in data.keys():
            if names is "":
                names += k
            else:
                names += " & " + k

        for v in data.values():
            wins = v
            break

        MVPsByWinsGraph.append(
            go.Bar(x=[names], y=[wins], name=filename.replace(".json", "")))

    g = utils.BuildPlot("MVPs by Wins", "mvps-by-wins", MVPsByWinsGraph,
                        "Team Owner", "Games Won")
    utils.PublishGraphToBlog(STATIC_HTML_PATH, filename, g)