1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { isArray } from 'zrender/lib/core/util.js';
- import { GraphicComponentModel } from './GraphicModel.js';
- import { GraphicComponentView } from './GraphicView.js';
- export function install(registers) {
- registers.registerComponentModel(GraphicComponentModel);
- registers.registerComponentView(GraphicComponentView);
- registers.registerPreprocessor(function (option) {
- var graphicOption = option.graphic;
-
-
-
-
-
- if (isArray(graphicOption)) {
- if (!graphicOption[0] || !graphicOption[0].elements) {
- option.graphic = [{
- elements: graphicOption
- }];
- } else {
-
-
- option.graphic = [option.graphic[0]];
- }
- } else if (graphicOption && !graphicOption.elements) {
- option.graphic = [{
- elements: [graphicOption]
- }];
- }
- });
- }
|