Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG]: Color Translation is Costly

Open
#8,054 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start with the scatter trace rendering path that calls rgb(color_string) and parse(color_string); compare it with the memoization PR mentioned in the report. Reproduce the 100,000-mark benchmark from the issue, then confirm the optimized run retains rendering behavior and improves median timing.

Written by the indexing model from the issue text.

Description

bug P2 size: 1
Description

When rendering a scatter trace, we run rgb(color_string) and parse(color_string) four times for every mark. For the vast majority of scatter charts, this is wasteful re-computation.

Surprisingly, this string parsing appears to be a serious bottleneck. Removing it seems to provide a 2x speed improvement for charts with large numbers of marks.

Screenshots/Video
Image
Steps to reproduce

Run npm start.
In the the console run:

const gd = document.getElementById('graph');
const n = 1e5, x = new Float64Array(n), y = new Float64Array(n);
for (let i = 0; i < n; i++) { x[i] = i; y[i] = Math.sin(i / 500); }
const runs = [];
for (let k = 0; k < 5; k++) {
    await Plotly.purge(gd);
    const t = performance.now();
    await Plotly.newPlot(gd, [{type: 'scatter', mode: 'markers', x, y}],
        {width: 900, height: 600}, {displayModeBar: false});
    runs.push(+(performance.now() - t).toFixed(1));
}
runs.sort((a, b) => a - b);
console.log('median', runs[2], runs);

See the numbers. Then test with the memoization PR I've put up and notice the lower numbers.

Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
1d 19h
Merged PRs (30d)
21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plotly/plotly.js

All issues in plotly/plotly.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.