MCPcopy
hub / github.com/apache/echarts / parseFinder

Function parseFinder

src/util/model.ts:828–864  ·  view source on GitHub ↗
(
    ecModel: GlobalModel,
    finderInput: ModelFinder,
    opt?: {
        // If no main type specified, use this main type.
        defaultMainType?: ComponentMainType;
        // If pervided, types out of this list will be ignored.
        includeMainTypes?: ComponentMainType[];
        enableAll?: boolean;
        enableNone?: boolean;
    }
)

Source from the content-addressed store, hash-verified

826 * The same behavior as `component.getReferringComponents`.
827 */
828export function parseFinder(
829 ecModel: GlobalModel,
830 finderInput: ModelFinder,
831 opt?: {
832 // If no main type specified, use this main type.
833 defaultMainType?: ComponentMainType;
834 // If pervided, types out of this list will be ignored.
835 includeMainTypes?: ComponentMainType[];
836 enableAll?: boolean;
837 enableNone?: boolean;
838 }
839): ParsedModelFinder {
840 const { mainTypeSpecified, queryOptionMap, others } = preParseFinder(finderInput, opt);
841 const result = others as ParsedModelFinderKnown;
842
843 const defaultMainType = opt ? opt.defaultMainType : null;
844 if (!mainTypeSpecified && defaultMainType) {
845 queryOptionMap.set(defaultMainType, {});
846 }
847
848 queryOptionMap.each(function (queryOption, mainType) {
849 const queryResult = queryReferringComponents(
850 ecModel,
851 mainType,
852 queryOption,
853 {
854 useDefault: defaultMainType === mainType,
855 enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,
856 enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true
857 }
858 );
859 result[mainType + 'Models'] = queryResult.models;
860 result[mainType + 'Model'] = queryResult.models[0];
861 });
862
863 return result;
864}
865
866export function preParseFinder(
867 finderInput: ModelFinder,

Callers 4

actionHandlerFunction · 0.90
DataZoom.tsFile · 0.90
constructorMethod · 0.90
findTargetInfoMethod · 0.90

Calls 3

preParseFinderFunction · 0.85
queryReferringComponentsFunction · 0.85
eachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…