apache / apache/echarts

[Bug] server side rendering fails when number of points larger than 10000

Open
#18,788 2 comments 0 reactions 1 assignee Claimed by @Ovilia View on GitHub
bug en SSR
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.4.2

### Link to Minimal Reproduction

https://github.com/oriolcx/echartsissue.git

### Steps to Reproduce

```
# using node v18.14.2

# clone repository
git clone https://github.com/oriolcx/echartsissue.git

# install dependencies
npm install

# running
# fine
node debug.scatter.js 9999

# error
node debug.scatter.js 10000
```

### Current Behavior

Server side render with node-canvas fails if number of points larger or equal than 10000

### Expected Behavior

Server side does not fail

### Environment

```markdown
- OS: Ubuntu 22.04.2 LTS
- Browser: node v18.14.2
- Framework:
```

### Any additional comments?

```
# code that fails if N >= 10000

var echarts = require("echarts");
const { createCanvas } = require("canvas");
const fs = require('fs')

if(process.argv.length !== 3) {
console.log("Specify number of points.")
process.exit()
}

N = Number(process.argv[2])

function make_scatter(data) {
const canvas = createCanvas(1024, 768);
const chart = echarts.init(canvas);

options = {
grid: {
right: 70,
bottom: 70,
},
xAxis: [{}],
yAxis: [{}],

animation: false,
series: [
{
type: "scatter",
data: data,
dimensions: ["x", "y"],
symbolSize: 3,
itemStyle: {
opacity: 0.4,
},
blendMode: "source-over",
large: true,
largeThreshold: 500,
},
],
};

chart.setOption(options);

const out = fs.createWriteStream("./scatter.png")
canvas.createPNGStream().pipe(out)
}

make_scatter(Array.from({length: N}, () => [Math.random(), Math.random()]));
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.