apache / apache/echarts

[Feature] Disconnect Toolbox from echarts.connect

Open
#21,679 1 comment 0 reactions 0 assignees View on GitHub
new-feature
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

Right now I have connected a few of my charts using ```echarts.connect``` [(docs)](https://echarts.apache.org/en/api.html#echarts.connect)

However, it also connects the toolbox from all the charts, so when using the ```magicType``` or ```saveAsImage``` feature, it will do these actions on all the connected charts. This will generate images of all the plots, instead of only the plot in question.

```
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar', 'stack'] },
restore: { show: true },
saveAsImage: { show: true }
}
},
```

The dataView does only display the data for the correct plot.

Image

### What does the proposed API look like?

An solution would be to have an extra parameter in toolbox like this:

```
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar', 'stack'] },
restore: { show: true },
saveAsImage: { show: true }
},
connect: false
},
```

Where connect would default to ```false```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how echarts.connect propagates toolbox actions, then compare that behavior with the existing dataView handling. Evaluate the proposed toolbox connect option and verify that magicType and saveAsImage can remain local while chart connections continue to coordinate charts. Done means the behavior and default are covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.