-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
feat(type): export EChartsInitOpts
and some Payload
types for echarts/core
#19103
Conversation
Thanks for your contribution! |
Great to see this, thanks! I found a couple more issues with types: #19003 (comment) |
src/export/core.ts
Outdated
export { RadialGradientObject } from 'zrender/src/graphic/RadialGradient'; | ||
export { PatternObject, ImagePatternObject, SVGPatternObject } from 'zrender/src/graphic/Pattern'; | ||
export { ElementEvent } from 'zrender/src/Element'; | ||
export * from './option'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this line. @pissang Do we miss an echarts/option
entry or echarts/all
entry? It seems we can only import them from echarts/types/dist
folder now. Please take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plainheart, you're right. I was looking for the incorrect type name for the option.
For example,
interface EChartsOption extends ECBasicOption {
dataset?: DatasetOption | DatasetOption[];
aria?: AriaOption;
title?: TitleOption | TitleOption[];
grid?: GridOption | GridOption[];
radar?: RadarOption | RadarOption[];
polar?: PolarOption | PolarOption[];
geo?: GeoOption | GeoOption[];
angleAxis?: AngleAxisOption | AngleAxisOption[];
radiusAxis?: RadiusAxisOption | RadiusAxisOption[];
xAxis?: XAXisOption | XAXisOption[];
yAxis?: YAXisOption | YAXisOption[];
singleAxis?: SingleAxisOption | SingleAxisOption[];
parallel?: ParallelCoordinateSystemOption | ParallelCoordinateSystemOption[];
parallelAxis?: ParallelAxisOption | ParallelAxisOption[];
calendar?: CalendarOption | CalendarOption[];
toolbox?: ToolboxComponentOption | ToolboxComponentOption[];
tooltip?: TooltipOption | TooltipOption[];
axisPointer?: AxisPointerOption | AxisPointerOption[];
brush?: BrushOption | BrushOption[];
timeline?: TimelineOption | SliderTimelineOption;
legend?: LegendComponentOption | (LegendComponentOption)[];
dataZoom?: DataZoomComponentOption | (DataZoomComponentOption)[];
visualMap?: VisualMapComponentOption | (VisualMapComponentOption)[];
graphic?: GraphicComponentLooseOption | GraphicComponentLooseOption[];
series?: SeriesOption$1 | SeriesOption$1[];
options?: EChartsOption[];
baseOption?: EChartsOption;
}
I was looking to import TooltipOption
type. However, it's already exported as TooltipComponentOption
, which is a little confusing when looking at the type.
I will revert this change.
EChartsInitOpts
and more types for echarts/core
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19103@a207f4f |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
EChartsInitOpts
and more types for echarts/core
EChartsInitOpts
and some Payload
types for echarts/core
Brief Information
Add missing types
This pull request is in the type of:
What does this PR do?
Expose useful types, so it can be imported via
echarts
Fixed issues
#19003
Details
Before: What was the problem?
In order to import types that not publicly expose via
echarts
, the current behaviour is something like thisAfter: How does it behave after the fixing?
After the change, users could import type in a correct way:
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information