When trying to create a scatter plot with long descriptions, the html file stops running. Unfortunately, the description cannot be shortened. Here’s a code snipped that will help reproduce the problem:
import numpy as np
import pandas as pd
import plotly.express as px
x = embedding2d[:, 0] # shape: (389000, 2)
y = embedding2d[:, 1] # shape: (389000, 2)
data = pd.DataFrame({
'x': x,
'y': y,
'label_category': labels.astype(str),
#'label_count': label_count,
'text': ['a' * 100] * len(df['Текст обращения'].dropna().tolist())
})
# Визуализация с plotly
fig = px.scatter(
data, x='x', y='y',
#template='plotly_dark',
#color='label_category',
#size='label_count',
hover_data=['label_category', 'text'], # Добавляем данные, которые будут отображаться при наведении
title="2D Vector Visualization with Labels",
)
fig.update_layout(
width=1520, height=685,
title_x=0.5
)
fig.show()
fig.write_html(name + '-visualization1.html')
P.s. Changing browser doesn’t help