* Notice: always force to input param `useDefault` in case that forget to consider it. * The same behavior as `modelUtil.parseFinder`. * * @param useDefault In many cases like series refer axis and axis refer grid, * If axis index / axis id not specified, use the first tar
(mainType: ComponentMainType, opt: QueryReferringOpt)
| 291 | * In other cases like dataZoom refer axis, if not specified, measn no refer. |
| 292 | */ |
| 293 | getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): { |
| 294 | // Always be array rather than null/undefined, which is convenient to use. |
| 295 | models: ComponentModel[]; |
| 296 | // Whether target component is specified |
| 297 | specified: boolean; |
| 298 | } { |
| 299 | const indexKey = (mainType + 'Index') as keyof Opt; |
| 300 | const idKey = (mainType + 'Id') as keyof Opt; |
| 301 | |
| 302 | return queryReferringComponents( |
| 303 | this.ecModel, |
| 304 | mainType, |
| 305 | { |
| 306 | index: this.get(indexKey, true) as unknown as ModelFinderIndexQuery, |
| 307 | id: this.get(idKey, true) as unknown as ModelFinderIdQuery |
| 308 | }, |
| 309 | opt |
| 310 | ); |
| 311 | } |
| 312 | |
| 313 | getBoxLayoutParams() { |
| 314 | // Consider itself having box layout configs. |
no test coverage detected