In the notebook, we can see that aspectmode="data"
is properly respected, but the frontend seems to be discarding the scene layout
Hi NonchalantWhale65 , can you provide a short code snippet that reproduces the problematic behaviour?
Hi CostlyOstrich36 , sure I’ll do that ASAP
The repro code:
import uuid
import numpy as np
from clearml import Task
from plotly import graph_objects as go
def start_clearml():
task_name = f"debug_plotsR{uuid.uuid1().hex}"
_clearml_init = dict(
project_name="debug_clearml_plots",
task_name=task_name,
tags=["debug"],
reuse_last_task_id=False,
)
task = Task.init(**_clearml_init)
return task
def repro_code(n: int = 1000):
task = start_clearml()
logger = task.get_logger()
# Dummy point cloud
xyz = np.zeros((n, 3), dtype=float)
xyz[:, 0] = np.random.uniform(-100, 100, n)
xyz[:, 1] = np.random.uniform(-30, 60, n)
xyz[:, 2] = np.random.uniform(0, 20, n)
color = np.zeros((n, 3), dtype=np.uint8)
color[:, 0] = np.random.randint(0, 255, size=n, dtype=np.uint8)
color[:, 1] = np.random.randint(0, 255, size=n, dtype=np.uint8)
color[:, 2] = np.random.randint(0, 255, size=n, dtype=np.uint8)
data = [go.Scatter3d(
x=xyz[:, 0],
y=xyz[:, 1],
z=xyz[:, 2],
mode="markers",
name="random_points",
marker=dict(color=color, size=1),
)]
fig = go.Figure(data=data)
fig.update_layout(
scene=dict(
aspectmode="data",
)
)
logger.report_plotly(
title="Example",
series="xyzrgb",
iteration=0,
figure=fig,
)
task.flush(wait_for_uploads=True)
task.close()
return fig
fig = repro_code()
What we get displaying fig
in a notebook:
But what we can in the ClearML frontend:
It used to work a few weeks ago, before the huge frontend change