-
Notifications
You must be signed in to change notification settings - Fork 309
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
Missing type for transform regression. #35
Comments
@y0nd0 @GreedyPirate this way works for me:
which is even better 'cause you don't need to import the whole ecStat package if you are going to use just one transformation. |
same issue, there is no 'transform' available from echarts-stat package my packages versions : anyone solved the problem ? |
any news? the same problem |
same issue, any suggestions please |
there is no 'transform' available from echarts-stat package. |
|
@dvago
I've tried downgrading echarts to 5.1.2, but then its giving following error.
|
@CDFO2 are you importing the library as:
Note: the above is bad practice but it's a work around. |
@CDFO2 I would try with this and see what happens: import * as echarts from 'echarts';
import { transform } from 'echarts-stat';
echarts.registerTransform(transform.regression);
var myChart = echarts.init(document.getElementById('main'));
var option; // whatever option you want to pass
myChart.setOption(option); This sequence (importing the library, registering the transformation and init the chart) has been provided by one of the library maintainer a few months ago. I'm not fully sure if this helps out 'cause the error says I've been raising a proposal and this guy opened an issue related to this registerTransform but it still open: #15124 |
Any update for the transform problem? |
Come on guys! when are you going to fix this? |
A fix would be really helpful!! |
Resorting to module augmentation till a fix is available: import type { ExternalDataTransform } from "@manufac/echarts-simple-transform";
/**
* Needed because of: https://github.com/ecomfe/echarts-stat/issues/35
* Module augmentation: https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation
*/
declare module "echarts-stat" {
let transform: {
regression: ExternalDataTransform;
histogram: ExternalDataTransform;
clustering: ExternalDataTransform;
};
} Took some hints from #41 as well. |
temporary solution: or:#41 |
I had the same issue and i found this solution: I replaced and in this way everything works as it should, but I have no idea of the reason why. Anyway I hope it helps ;) |
The above doesn't work anymore because of TypeScript, you can try this instead:
|
Found Another way of implementing in Angular Run Register Transform inside lifecycle hook.
|
您好,这里是周敏。您的来信我已收到,我会在查看后的第一时间给你回复。
|
import { transform } from 'echarts-stat' this should be the correct solution, the current solutions are not tree shakeable |
If you are interested in regression, you can use my script. I took and rewrote several files from the library and now I don’t need to install the entire library. This solved the problem with imports. https://github.com/oleksandr-kupenko/echarts-stat-regression |
您好,这里是周敏。您的来信我已收到,我会在查看后的第一时间给你回复。
|
this works. i imported the ecStat and change it to any type. and follow the rest. import * as ecStat from 'echarts-stat'; const ecStatLocal: any = ecStat; |
It's useful,thanks. |
How to use transform regression in echarts (ngx-echarts) TypeScript? Missing type?
ecStat.d.ts
Goal: https://echarts.apache.org/examples/en/editor.html?c=scatter-linear-regression
The text was updated successfully, but these errors were encountered: