(
api: ExtensionAPI,
opts?: {
text?: string;
color?: string;
textColor?: string;
maskColor?: string;
zlevel?: number;
showSpinner?: boolean;
spinnerRadius?: number;
lineWidth?: number;
fontSize?: number;
fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
fontStyle?: 'normal' | 'italic' | 'oblique';
fontFamily?: string
}
)
| 34 | * @return {module:zrender/Element} |
| 35 | */ |
| 36 | export default function defaultLoading( |
| 37 | api: ExtensionAPI, |
| 38 | opts?: { |
| 39 | text?: string; |
| 40 | color?: string; |
| 41 | textColor?: string; |
| 42 | maskColor?: string; |
| 43 | zlevel?: number; |
| 44 | showSpinner?: boolean; |
| 45 | spinnerRadius?: number; |
| 46 | lineWidth?: number; |
| 47 | fontSize?: number; |
| 48 | fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number; |
| 49 | fontStyle?: 'normal' | 'italic' | 'oblique'; |
| 50 | fontFamily?: string |
| 51 | } |
| 52 | ): LoadingEffect { |
| 53 | opts = opts || {}; |
| 54 | zrUtil.defaults(opts, { |
| 55 | text: 'loading', |
| 56 | textColor: tokens.color.primary, |
| 57 | fontSize: 12, |
| 58 | fontWeight: 'normal', |
| 59 | fontStyle: 'normal', |
| 60 | fontFamily: 'sans-serif', |
| 61 | maskColor: 'rgba(255,255,255,0.8)', |
| 62 | showSpinner: true, |
| 63 | color: tokens.color.theme[0], |
| 64 | spinnerRadius: 10, |
| 65 | lineWidth: 5, |
| 66 | zlevel: 0 |
| 67 | }); |
| 68 | const group = new graphic.Group() as (graphic.Group & LoadingEffect); |
| 69 | const mask = new graphic.Rect({ |
| 70 | style: { |
| 71 | fill: opts.maskColor |
| 72 | }, |
| 73 | zlevel: opts.zlevel, |
| 74 | z: 10000 |
| 75 | }); |
| 76 | group.add(mask); |
| 77 | |
| 78 | const textContent = new graphic.Text({ |
| 79 | style: { |
| 80 | text: opts.text, |
| 81 | fill: opts.textColor, |
| 82 | fontSize: opts.fontSize, |
| 83 | fontWeight: opts.fontWeight, |
| 84 | fontStyle: opts.fontStyle, |
| 85 | fontFamily: opts.fontFamily |
| 86 | }, |
| 87 | zlevel: opts.zlevel, |
| 88 | z: 10001 |
| 89 | }); |
| 90 | |
| 91 | const labelRect = new graphic.Rect({ |
| 92 | style: { |
| 93 | fill: 'none' |
nothing calls this directly
no test coverage detected
searching dependent graphs…