Example #1
0
def plotBalken(db, table, **xargs):
    data = read(db, table)
    return _plotly(
        #[Bar(**data[0])],
        [Bar(name=(k if k != 0 else None), **v) for k, v in data.items()],
        table,
        **xargs)
Example #2
0
def plotTorte(db, table, **xargs):
    data = read(db, table)
    return _plotly(
        [dict(
            labels=data[0]["x"],
            values=data[0]["y"],
            type="pie",
        )], table, **xargs)
Example #3
0
def plotBubbles(db, table, **xargs):
    data = read(db, table)
    return _plotly(
        [
            Scatter(
                name=k,
                mode='markers',
                marker=dict(size=v.pop("s", None),
                            #sizemode='diameter',sizeref=1,
                            ),
                **v) for k, v in data.items()
        ],
        table,
        **xargs)
Example #4
0
def plot3D(db, table, xTitle=None, yTitle=None, zTitle=None, **xargs):
    data = read(db, table)
    fill_colors = ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854']
    return _plotly(
        [
            dict(
                #type='surface',
                type='scatter3d',
                mode='lines',
                surfaceaxis=2,
                line=dict(color='black', width=4),
                surfacecolor=fill_colors[i % len(fill_colors)],
                name=(k if k != 0 else None),
                **v) for i, (k, v) in enumerate(data.items())
        ],
        table,
        scene=dict(
            xaxis=dict(title=xTitle),
            yaxis=dict(title=yTitle),
            zaxis=dict(title=zTitle),
            camera=dict(eye=dict(x=-1.7, y=-1.7, z=0.5)),
        ),
        **xargs)
Example #5
0
def plot(db, table, mode='lines+markers', **xargs):
    data = read(db, table)
    scatterData = [Scatter(name=k, mode=mode, **v) for k, v in data.items()]
    return _plotly(scatterData, table, **xargs)
Example #6
0
def plotBoxplot(db, table, **xargs):
    data = read(db, table)
    return _plotly(
        [Box(x=v.get("x", None), y=v["y"], name=k) for k, v in data.items()],
        table, **xargs)