Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOME Kaleido #188

Open
zN3utr4l opened this issue May 18, 2023 · 4 comments
Open

OOME Kaleido #188

zN3utr4l opened this issue May 18, 2023 · 4 comments
Labels
bug something broken P3 not needed for current cycle

Comments

@zN3utr4l
Copy link

I have a linux debian 11 pc with docker and various containers.
It freezes every time you operate on docker and restart.
Online I found this thing:
image
Container Process
image

The container in question has a celery scheduler that performs tasks in parallel, including the creation of svg with plotly.

......
import plotly.graph_objects as go
from plotly.subplots import make_subplots


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

fig.update_layout(
    annotations=[
        dict(
            text='Duration',
            x=0.85,
            y=0.5,
            # font_size=40,
            showarrow=False,
            font=dict(
                family='Arial',
                size=28.5,
                color='grey'
            )
        ),
        # COUNT
        dict(
            text='Count',
            x=0.17,
            y=0.5,
            # font_size=40,
            showarrow=False,
            font=dict(
                family='Arial',
                size=28.5,
                color='grey'
            )
        ),
    ]
)

labels_counts = [1, 2, 3]
labels_duration = [1, 2, 3]

fig.add_trace(
    go.Pie(
        labels=labels_counts,
        values=[1, 2, 3],
        texttemplate='%{percent}<br>(%{value})',
    ), 1, 1)

fig.add_trace(
    go.Pie(
        labels=labels_duration,
        values=[1, 2, 3],
        customdata=[1, 2, 3],
        texttemplate='%{percent}<br>(%{customdata})'
    ), 1, 2)

fig.update_traces(
    hole=0.7,
    textinfo='percent',
    textposition='outside',
    textfont_size=12,
    marker=dict(colors=['red', 'blu'],
                line=dict(color='#FFFFFF',
                            width=5)
                ),
    textfont=dict(
        family='Arial',
        size=18,
        color='grey'
    )
)

# Legend
fig.update_layout(
    legend=dict(
        yanchor='top',
        y=0.99,
        xanchor='left',
        x=-0.33,
        bgcolor='rgba(0,0,0,0)',
    )
)

# Size of img
fig.update_layout(
    autosize=False,
    width=1250,
    height=455,
)

fig.update_layout(
    font=dict(
        family='Calibri Light',
        size=22,
        color='black'
    )
)

fig.write_image('pie_chart.svg')





fig = go.Figure(layout=go.Layout(autosize=False,width=1850,height=750))

x = [date.today(), date.today() + timedelta(days=12)]

fig.add_traces(go.Scatter(x=[], y=[[1, 2, 3], [1, 2, 3]], showlegend=False, mode='markers', marker=dict(color='rgba(255, 245, 135, 0)')))
fig.add_traces(go.Scatter(x=x, y=[5, 5], mode='lines', line=dict(color='#FFB775', width=3), name='High'))
fig.add_traces(go.Scatter(x=x, y=[1, 1], mode='lines', line=dict(color='#FFB775', width=3), name='Low'))
fig.add_traces(go.Scatter(x=x,y=[1, 10],mode='lines',line=dict(color='#FFA3A6', width=6, dash='dash'),name='trend'))


fig.add_traces(go.Scatter(x=[date.today()], y=[4], name='this period',mode='lines', line=dict(color='#E7E6F0', width=6), line_shape='spline', showlegend=False))

fig.add_traces(go.Scatter(x=[date.today()], y=[0.1], name='Last period',mode='markers', marker=dict(color='#A3A1A8', size=11)))

fig.add_traces(go.Scatter(x=[date.today()], y=[5], showlegend=False, name='5% low', mode='lines', line=dict(color='#A3A1A8', width=1), line_shape='spline'))
fig.add_traces(go.Scatter(x=[date.today()], y=[6], name='90% range', mode='lines', line=dict(color='#A3A1A8', width=1), line_shape='spline', fill='tonexty', fillcolor='rgba(231, 230, 240,0.3)'))

text_date = ['1/1/2001']

fig.add_traces(go.Scatter(x=[date.today()], y=[1], name='this period', mode='markers+text', textposition='top center', textfont_size=10, text=text_date, marker=dict(color='#7D6B7D', size=11)))


fig.add_traces(go.Scatter(
    x=list([date.today()]),
    y=[1],
    mode='markers',
    marker=dict(
        color='#FF665A',
        size=19),
    name='warnings'
))

fig.update_layout({
    'plot_bgcolor': 'rgba(0, 0, 0, 0)',
    'paper_bgcolor': 'rgba(0, 0, 0, 0)',
    }, font=dict(size=32))

fig.update_xaxes(
    showgrid=True,
    gridwidth=1,
    gridcolor='rgba(0, 0, 0, 0.1)'
    )


fig.update_yaxes(
    showgrid=True,
    gridwidth=1,
    gridcolor='rgba(0, 0, 0, 0.1)',
    ticksuffix='A'
    )

fig.write_image('tempo.svg')```
@Elsper01
Copy link

Which kaleido version are you using?
I had similiar problems and fix it by using the following kaleido version: kaleido==0.1.0.post1

@zN3utr4l
Copy link
Author

  • plotly=5.14.1=pyhd8ed1ab_0
  • kaleido-core=0.2.1=h3644ca4_0
  • python-kaleido=0.2.1=pyhd8ed1ab_0

Installed with conda

@Elsper01
Copy link

ok, than maybe try to run the python script again with kaleido version 0.1.0.post1

@zN3utr4l zN3utr4l mentioned this issue May 19, 2023
@gvwilson gvwilson transferred this issue from plotly/plotly.py Jul 11, 2024
@gvwilson gvwilson self-assigned this Jul 26, 2024
@gvwilson
Copy link
Collaborator

Thanks for your interest in Kaleido. We are currently working on an overhaul that might address your issue - we hope to have news in a few weeks and will post an update then. Thanks - @gvwilson

@gvwilson gvwilson removed their assignment Aug 3, 2024
@gvwilson gvwilson added bug something broken P3 not needed for current cycle labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

3 participants