-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Milestone
Description
Describe the bug
The to_js_literal method is taking excessively long time.
Steps Reproduce
- First, let us create a 4000 points dataset.
import seaborn as sns
original_df = sns.load_dataset('iris')
df = sns.load_dataset('iris')
for i in range(26):
df = df.append(original_df, ignore_index=True)
df
2. Now, create a Highcharts Python chart.
from highcharts_core.chart import Chart
from highcharts_core.options.series.scatter import ScatterSeries
from highcharts_core.options.plot_options import PlotOptions
ch = Chart.from_pandas(
df,
property_map={
'x': 'petal_width',
'y': 'sepal_length',
},
series_type='scatter',
)
# Disable boost.
ch.options.plot_options = PlotOptions(series=ScatterSeries(turbo_threshold=0))
- Then, when chart is displayed. the bulk of time goes in to_js_literal method. This particular method takes 21 seconds - See python profiling screenshot.
display(ch)
Expected behavior
I observed that:
- IF the number of rows in the input
DataFrame
decreases, so does the time taken byto_js_literal
method. - Why is this method taking so much time? I looked at the code - it seems that this is a recursive method. Due to this method taking 21 seconds, entire rendering time is 28 seconds. This is not a great user experience that you've to wait for half-a-minute to view your chart.
Your Environment
- OS: Windows, Jupyter Lab (notebook).
- Python Version:
3.10.4
- Highcharts Version: Installed
Highcharts Python
usingpip install highcharts-core
command.
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Type
Projects
Status
Done