Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some of Echarts' internal types should be exported (eg: ElementEvent) #15284

Closed
iuliust opened this issue Jul 2, 2021 · 2 comments · Fixed by #15291
Closed

Some of Echarts' internal types should be exported (eg: ElementEvent) #15284

iuliust opened this issue Jul 2, 2021 · 2 comments · Fixed by #15291
Labels
difficulty: easy Issues that can be fixed more easily than the average. en This issue is in English typescript

Comments

@iuliust
Copy link

iuliust commented Jul 2, 2021

Version

5.1.2

Steps to reproduce

Try to get a reference to the ElementEvent type of echartsInstance.on(eventName, (event) => {...})

What is expected?

In a typescript project, we should be able to get the reference to the ElementEvent type, among other types.

What is actually happening?

There's no way to get a clean reference to the type


In general, a very, very limited part of Echarts' internal types are exported. This is a big problem, because when I want to declare an observable of ElementEvent, it is just impossible.
I want to be able to have the following code :

import { ElementEvent } from 'echarts';
// ...

export class ChartComponent {
  chartClickEvents = new Subject<ElementEvent>(); // Unfortunately, it's impossible because Echart's types are almost never exported...

  constructor() {
     // ...
     this.echartsInstance.on('click', event => {
        this.chartClickEvents.next(event);
     });

     this.chartClickEvents.pipe(
          tap(e => {
                  // do stuff...
           }),
     ).subscribe();
  }
}
@echarts-bot
Copy link

echarts-bot bot commented Jul 2, 2021

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so.

A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added bug en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jul 2, 2021
@pissang pissang added difficulty: easy Issues that can be fixed more easily than the average. typescript and removed bug pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jul 2, 2021
@echarts-bot
Copy link

echarts-bot bot commented Jul 2, 2021

This issue is labeled with difficulty: easy.
@iuliust Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

Please have a look at How to debug ECharts if you'd like to give a try. 🤓

@pissang pissang added this to the 5.3 milestone Jul 2, 2021
Map1en added a commit to Map1en/echarts that referenced this issue Jul 5, 2021
@Map1en Map1en mentioned this issue Jul 5, 2021
6 tasks
@pissang pissang modified the milestones: 5.3, 5.4 Jan 4, 2022
@Ovilia Ovilia removed this from the 5.4 milestone Sep 1, 2022
Wetterquarz added a commit to development-scopeland/echarts that referenced this issue Sep 12, 2022
* chore(type): export type ElementEvent

close apache#15284

* rm newline

* feat(graph): simple layout graph support dragging

* test(graph): add simple graph draggable test case

* feat(graph): update circular layout helper function

* feat(graph): support draggable for all graph layout ('none' | 'circular' | 'force')

* test(graph): add graph draggable test case

* Revert "test(graph): add simple graph draggable test case"

This reverts commit 78b2475.

* fix(graph): node el check for circular layout

* fix(graph): remove GraphNode `_fixed` field

* fix(graph): use zrender/vector calculate node layout

* fix: not trigger roam on el's child

* fix: fix code

* fix: remove useless code

* fix: store fixed state in layout object

* fix: use mouse position calculate circular layout

* feat(LineDraw):series-lines support the effect animation go back

* rename the option from goback to roundTrip

* feat: ignore target size for large charts

* feat: make target size an option

* feat: rename test file

* feat: rename variables

* feat(pie): support specifying coordinate system for pie series.

* feat(bmap): support `convertToPixel` & `convertFromPixel` API.

* fix: sliderZoom in candlestick dataset error

* chore(workflow): close stale issues as not planned rather than completed. [ci skip]

* fix(custom): fix potential NPE when applying leave transition.

* chore: upgrade stale action to v5

fix `close-issue-reason` option is not being recognized

* fix(log): fix log axis breaks a single data whose log value is negative apache#13154

* fix(log): cache base variable

* fix(axis): fix axis symbol is not reverted when axis is reverse.

* feat(gauge): axisLabel support rotate like sunburst. close 15944

* fix(visualMap): fix the indicator doesn't show when hovering on map label.

* chore: fix some typos

* fix(visualMap): fix wrong type of ecData.

* fix(custom): fix elements may not be removed after updates apache#17333

* fix(custom): apply leave transition and add more comments

* test(custom): add a test case with {} that should preserve child

* test(custom): add a test case

* test: add coarse-pointer in test env

* fix(custom): fix the case for element after the null child

* style: spelling mistakes

* style: spelling mistakes

* style: spelling mistakes

* fix(type): add missing type `number` to `emphasis.scale` of scatter/line/graph series.

* style: fix typo of `RoamPayload`.

* refactor(util): import `encodeHTML` function from `zrender`.

* chore(deps-dev): bump terser from 5.3.8 to 5.14.2

Bumps [terser](https://github.com/terser/terser) from 5.3.8 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: update zrender to the latest nightly version.

* fix(pie): fix `labelLine` may not be hidden when `minShowLabelRadian` is specified, resolves apache#17013.

* 单轴反向失效问题修复

* fix(custom): ignore element when renderItem returns a group with null elements

* test(custom): update test case for custom update

* fix(bar-race): provide subPixelOptimize option to solve apache#14679

* test(bar-race): update test

* fix(symbol): fix `emphasis.scale` can't be reset and specified value may not be respect.

- null / undefined / true means to use default strategy.
- 0 / false / negative number / NaN / Infinity means no scale.

* test(symbol): add test case for `emphasis.scale`

* test(vrt): fix changing value of select via js doesn't trigger `change` event.

* fix(symbol): remove unused import.

* fix(custom): set ignore only if old child exists (apache#17450)

* feat(axis): set subPixelOptimize to be false during animation

* chore: fix wrong imports from `echarts.all`

* chore: fix wrong imports from `echarts.all`

* fix(axis): remove unnecessary files

* 优化饼图性能

* fix(axis): when update for the first time, make sure done is called

* test(pie): tweak pie-percent case - add time log, percentPrecision & label formatter.

* test(pie): fix test case pie3.html

* fix(theme): fix the abandoned normal level in the theme file. close apache#17473

* fix(coarse-pointer): use retrieve

* fix(theme):  move the label block to the outside.

* fix(subpixel): set animation with subpixel optimization

* fix(subpixel): remove function

* fix(subpixel): refactor

* fix(subpixel): refactor subPixelOptimizeLine

* fix(subpixel): remove an unexpected change

* feat(coarse-pointer): fix test

* feat(coarse-pointer): fix test

* fix: merge conflict

* chore(deps): bump engine.io and socket.io

Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together.

Updates `engine.io` from 3.3.2 to 3.6.0
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md)
- [Commits](socketio/engine.io@3.3.2...3.6.0)

Updates `socket.io` from 2.2.0 to 2.5.0
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/2.5.0/CHANGELOG.md)
- [Commits](socketio/socket.io@2.2.0...2.5.0)

---
updated-dependencies:
- dependency-name: engine.io
  dependency-type: indirect
- dependency-name: socket.io
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(theme): fix tooltips text style of the theme macarons

* change the  `deprecateReplaceLog` in  sunburstAction.ts

* fix the  deprecateReplaceLog  about downplay

* fix a typo error in `log.ts`

* chore(stale): issues with milestone TBD should not be marked as stale

* chore(stale): exclude all prs with milestones

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Map1en_ <[email protected]>
Co-authored-by: kongmoumou <[email protected]>
Co-authored-by: sushuang <[email protected]>
Co-authored-by: Yi Shen <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Ovilia <[email protected]>
Co-authored-by: plainheart <[email protected]>
Co-authored-by: jiawulin001 <[email protected]>
Co-authored-by: MeetzhDing <[email protected]>
Co-authored-by: ZT <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 杨骥 <[email protected]>
Co-authored-by: liangism <[email protected]>
Co-authored-by: mousne <[email protected]>
Co-authored-by: gitforhlp <[email protected]>
Co-authored-by: ChepteaCatalin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Issues that can be fixed more easily than the average. en This issue is in English typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants