@wavemaker-ai/app-rn-runtime 1.0.0-rc.328 → 1.0.0-rc.332
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/basic/anchor/anchor.component.js +4 -4
- package/components/basic/anchor/anchor.component.js.map +1 -1
- package/components/basic/anchor/anchor.props.js +1 -0
- package/components/basic/anchor/anchor.props.js.map +1 -1
- package/components/basic/icon/icon.component.js +29 -2
- package/components/basic/icon/icon.component.js.map +1 -1
- package/components/basic/icon/svg-url-icon.component.js +80 -0
- package/components/basic/icon/svg-url-icon.component.js.map +1 -0
- package/components/basic/search/search.component.js +3 -1
- package/components/basic/search/search.component.js.map +1 -1
- package/components/basic/search/search.props.js +3 -0
- package/components/basic/search/search.props.js.map +1 -1
- package/components/basic/spinner/spinner.component.js +1 -0
- package/components/basic/spinner/spinner.component.js.map +1 -1
- package/components/basic/spinner/spinner.props.js +1 -0
- package/components/basic/spinner/spinner.props.js.map +1 -1
- package/components/chart/area-chart/area-chart.component.js +12 -6
- package/components/chart/area-chart/area-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js +14 -7
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/basechart.props.js +1 -0
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/basechart.styles.js +0 -1
- package/components/chart/basechart.styles.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js +25 -6
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js +12 -6
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.component.js +24 -4
- package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.props.js +1 -1
- package/components/chart/pie-chart/pie-chart.props.js.map +1 -1
- package/components/container/accordion/accordion.component.js +11 -3
- package/components/container/accordion/accordion.component.js.map +1 -1
- package/components/container/accordion/accordion.props.js +2 -0
- package/components/container/accordion/accordion.props.js.map +1 -1
- package/components/container/accordion/accordionpane/accordionpane.props.js +1 -0
- package/components/container/accordion/accordionpane/accordionpane.props.js.map +1 -1
- package/components/container/panel/panel.component.js +3 -1
- package/components/container/panel/panel.component.js.map +1 -1
- package/components/container/panel/panel.props.js +2 -0
- package/components/container/panel/panel.props.js.map +1 -1
- package/components/container/wizard/wizard.component.js +7 -3
- package/components/container/wizard/wizard.component.js.map +1 -1
- package/components/container/wizard/wizard.props.js +1 -0
- package/components/container/wizard/wizard.props.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.props.js +3 -0
- package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- package/components/data/form/form.component.js +3 -2
- package/components/data/form/form.component.js.map +1 -1
- package/components/data/form/form.props.js +1 -0
- package/components/data/form/form.props.js.map +1 -1
- package/components/data/list/list.component.js +5 -3
- package/components/data/list/list.component.js.map +1 -1
- package/components/data/list/list.props.js +2 -0
- package/components/data/list/list.props.js.map +1 -1
- package/components/input/basedataset/basedataset.component.js +2 -1
- package/components/input/basedataset/basedataset.component.js.map +1 -1
- package/components/input/basedataset/basedataset.props.js +1 -0
- package/components/input/basedataset/basedataset.props.js.map +1 -1
- package/components/input/fileupload/fileupload.component.js +1 -0
- package/components/input/fileupload/fileupload.component.js.map +1 -1
- package/components/input/fileupload/fileupload.props.js +1 -0
- package/components/input/fileupload/fileupload.props.js.map +1 -1
- package/components/input/rating/rating.component.js +4 -2
- package/components/input/rating/rating.component.js.map +1 -1
- package/components/input/rating/rating.props.js +4 -0
- package/components/input/rating/rating.props.js.map +1 -1
- package/components/input/switch/switch.component.js +2 -1
- package/components/input/switch/switch.component.js.map +1 -1
- package/components/input/text/text.component.js +6 -3
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +2 -0
- package/components/input/text/text.props.js.map +1 -1
- package/components/navigation/basenav/basenav.component.js +2 -0
- package/components/navigation/basenav/basenav.component.js.map +1 -1
- package/components/navigation/basenav/basenav.props.js +1 -0
- package/components/navigation/basenav/basenav.props.js.map +1 -1
- package/components/navigation/menu/menu.component.js +3 -0
- package/components/navigation/menu/menu.component.js.map +1 -1
- package/components/navigation/menu/menu.props.js +2 -0
- package/components/navigation/menu/menu.props.js.map +1 -1
- package/components/navigation/popover/popover.component.js +1 -0
- package/components/navigation/popover/popover.component.js.map +1 -1
- package/components/navigation/popover/popover.props.js +1 -0
- package/components/navigation/popover/popover.props.js.map +1 -1
- package/components/page/tabbar/tabbar.component.js +2 -1
- package/components/page/tabbar/tabbar.component.js.map +1 -1
- package/components-prism/basic/search/search.component.js +3 -1
- package/components-prism/basic/search/search.component.js.map +1 -1
- package/components-prism/basic/search/search.props.js +1 -0
- package/components-prism/basic/search/search.props.js.map +1 -1
- package/core/components/floatinglabel.component.js +2 -2
- package/core/components/floatinglabel.component.js.map +1 -1
- package/core/components/textinput.component.js +1 -0
- package/core/components/textinput.component.js.map +1 -1
- package/core/utils.js +16 -0
- package/core/utils.js.map +1 -1
- package/npm-shrinkwrap.json +253 -218
- package/package-lock.json +253 -218
- package/package.json +6 -6
|
@@ -31,8 +31,11 @@ export default class WmSearchProps extends BaseDatasetProps {
|
|
|
31
31
|
_defineProperty(this, "skeletonheight", null);
|
|
32
32
|
_defineProperty(this, "skeletonwidth", null);
|
|
33
33
|
_defineProperty(this, "iconclass", 'wm-sl-l sl-search');
|
|
34
|
+
_defineProperty(this, "iconurl", undefined);
|
|
34
35
|
_defineProperty(this, "clearsearchiconclass", 'wi wi-clear');
|
|
36
|
+
_defineProperty(this, "clearsearchiconurl", undefined);
|
|
35
37
|
_defineProperty(this, "searchiconclass", undefined);
|
|
38
|
+
_defineProperty(this, "searchiconurl", undefined);
|
|
36
39
|
_defineProperty(this, "debouncetime", 0);
|
|
37
40
|
}
|
|
38
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseDatasetProps","WmSearchProps","constructor","args","_defineProperty","undefined"],"sources":["search.props.ts"],"sourcesContent":["import BaseDatasetProps from '@wavemaker-ai/app-rn-runtime/components/input/basedataset/basedataset.props';\nimport {BaseComponent} from \"@wavemaker-ai/app-rn-runtime/core/base.component\";\nimport { AccessibilityRole } from 'react-native';\n\nexport default class WmSearchProps extends BaseDatasetProps {\n autofocus: boolean = false;\n query?: string = '';\n searchkey?: any;\n type: 'search' | 'autocomplete' = 'search';\n datacompletemsg?: string = 'No more data to load';\n placeholder?: string = 'Search';\n limit?: number = null as any;\n minchars?: number = null as any;\n imagewidth?: any = 32;\n imageheight?: any = 32;\n searchon?: string = 'typing';\n onSubmit?: any;\n onChange?: Function = null as any;\n result?: any;\n showclear: boolean = false;\n showSearchIcon: boolean = true; // internal property\n invokeEvent?: Function;\n formFieldInstance?: BaseComponent<any, any, any>;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = 'search';\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n iconclass?: string = 'wm-sl-l sl-search';\n clearsearchiconclass?: string = 'wi wi-clear';\n searchiconclass?: string = undefined;\n debouncetime?: number = 0;\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,6EAA6E;AAI1G,eAAe,MAAMC,aAAa,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACrC,KAAK;IAAAA,eAAA,gBACT,EAAE;IAAAA,eAAA;IAAAA,eAAA,eAEe,QAAQ;IAAAA,eAAA,0BACf,sBAAsB;IAAAA,eAAA,sBAC1B,QAAQ;IAAAA,eAAA,gBACd,IAAI;IAAAA,eAAA,mBACD,IAAI;IAAAA,eAAA,qBACL,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA,mBACF,QAAQ;IAAAA,eAAA;IAAAA,eAAA,mBAEN,IAAI;IAAAA,eAAA;IAAAA,eAAA,oBAEL,KAAK;IAAAA,eAAA,yBACA,IAAI;IAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAGFC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,QAAQ;IAAAA,eAAA;IAAAA,eAAA,yBAEtB,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,oBACR,mBAAmB;IAAAA,eAAA,+
|
|
1
|
+
{"version":3,"names":["BaseDatasetProps","WmSearchProps","constructor","args","_defineProperty","undefined"],"sources":["search.props.ts"],"sourcesContent":["import BaseDatasetProps from '@wavemaker-ai/app-rn-runtime/components/input/basedataset/basedataset.props';\nimport {BaseComponent} from \"@wavemaker-ai/app-rn-runtime/core/base.component\";\nimport { AccessibilityRole } from 'react-native';\n\nexport default class WmSearchProps extends BaseDatasetProps {\n autofocus: boolean = false;\n query?: string = '';\n searchkey?: any;\n type: 'search' | 'autocomplete' = 'search';\n datacompletemsg?: string = 'No more data to load';\n placeholder?: string = 'Search';\n limit?: number = null as any;\n minchars?: number = null as any;\n imagewidth?: any = 32;\n imageheight?: any = 32;\n searchon?: string = 'typing';\n onSubmit?: any;\n onChange?: Function = null as any;\n result?: any;\n showclear: boolean = false;\n showSearchIcon: boolean = true; // internal property\n invokeEvent?: Function;\n formFieldInstance?: BaseComponent<any, any, any>;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = 'search';\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n iconclass?: string = 'wm-sl-l sl-search';\n iconurl?: string = undefined;\n clearsearchiconclass?: string = 'wi wi-clear';\n clearsearchiconurl?: string = undefined;\n searchiconclass?: string = undefined;\n searchiconurl?: string = undefined;\n debouncetime?: number = 0;\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,6EAA6E;AAI1G,eAAe,MAAMC,aAAa,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACrC,KAAK;IAAAA,eAAA,gBACT,EAAE;IAAAA,eAAA;IAAAA,eAAA,eAEe,QAAQ;IAAAA,eAAA,0BACf,sBAAsB;IAAAA,eAAA,sBAC1B,QAAQ;IAAAA,eAAA,gBACd,IAAI;IAAAA,eAAA,mBACD,IAAI;IAAAA,eAAA,qBACL,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA,mBACF,QAAQ;IAAAA,eAAA;IAAAA,eAAA,mBAEN,IAAI;IAAAA,eAAA;IAAAA,eAAA,oBAEL,KAAK;IAAAA,eAAA,yBACA,IAAI;IAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAGFC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,QAAQ;IAAAA,eAAA;IAAAA,eAAA,yBAEtB,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,oBACR,mBAAmB;IAAAA,eAAA,kBACrBC,SAAS;IAAAD,eAAA,+BACI,aAAa;IAAAA,eAAA,6BACfC,SAAS;IAAAD,eAAA,0BACZC,SAAS;IAAAD,eAAA,wBACXC,SAAS;IAAAD,eAAA,uBACV,CAAC;EAAA;AAC3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","Platform","Color","BaseComponent","BaseComponentState","WmSpinnerProps","DEFAULT_CLASS","WmIcon","WmPicture","LottieView","ThemeVariables","UIPreferencesConsumer","WmSpinnerState","WmSpinner","constructor","props","_defineProperty","obj","colors","Object","keys","forEach","key","value","ind","Math","floor","random","length","toLowerCase","includes","shape","recursiveSearch","prepareIcon","createElement","id","getTestId","styles","icon","iconclass","iconsize","prepareImage","image","picturesource","toRgbArray","color","red","green","blue","addClasstoLottie","lottiePath","inheritThemePrimary","json","primaryColor","INSTANCE","darken","loader","prepareLottie","loaderConfig","_Lottie","Lottie","OS","require","default","animationSource","lottie","animationData","loop","play","style","_extends","getTestProps","source","resizeMode","autoPlay","renderWidget","preferences","appLoader","root","onLayout","event","handleLayout","_background","caption","getTestPropsForLabel","text"],"sources":["spinner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, Platform } from 'react-native';\nimport Color from \"color\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nimport WmSpinnerProps from './spinner.props';\nimport { DEFAULT_CLASS, WmSpinnerStyles } from './spinner.styles';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';\nimport LottieView from 'lottie-react-native';\nimport ThemeVariables from '@wavemaker-ai/app-rn-runtime/styles/theme.variables';\nimport { UIPreferencesConsumer, UI_PREFERENCES } from \"@wavemaker-ai/app-rn-runtime/core/ui-preferences.context\";\nexport class WmSpinnerState extends BaseComponentState<WmSpinnerProps> {\n\n}\n\nexport default class WmSpinner extends BaseComponent<WmSpinnerProps, WmSpinnerState, WmSpinnerStyles> {\n\n constructor(props: WmSpinnerProps) {\n super(props, DEFAULT_CLASS, new WmSpinnerProps());\n }\n\n private prepareIcon(props: any) {\n return (<WmIcon\n id={this.getTestId('icon')}\n styles={this.styles.icon}\n iconclass={props.iconclass + ' fa-spin'} iconsize={props.iconsize}></WmIcon>);\n }\n\n private prepareImage(props: any) {\n return (<WmPicture\n id={this.getTestId('picture')}\n styles={this.styles.image}\n picturesource={props.image}></WmPicture>);\n }\n\n private recursiveSearch = (obj: any, colors: any) => {\n obj && Object.keys(obj).forEach(key => {\n let value = obj[key];\n let ind = Math.floor(Math.random() * (0 - colors.length ) + colors.length);\n if (key == \"nm\" && (value.toLowerCase().includes('fill ') || value.toLowerCase().includes('stroke '))) {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]\n && (obj[\"c\"][\"k\"].length == 4\n || (obj[\"c\"][\"k\"].length ==3\n && typeof obj[\"c\"][\"k\"][0] == 'number'))) {\n obj[\"c\"][\"k\"] = colors[ind];\n }\n else {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]){\n for (let shape in obj[\"c\"][\"k\"]) {\n if(obj[\"c\"][\"k\"][shape] && obj[\"c\"][\"k\"][shape][\"s\"]){\n obj[\"c\"][\"k\"][shape][\"s\"] = colors[ind];\n }\n }\n }\n }\n } else if (typeof value === 'object') {\n this.recursiveSearch(value, colors);\n }\n });\n return obj;\n };\n\n private toRgbArray(color: Color) {\n return [\n color.red()/255,\n color.green()/255,\n color.blue()/255,\n 1\n ]\n }\n\n private addClasstoLottie(lottiePath: any, inheritThemePrimary: boolean) {\n if (inheritThemePrimary === false){\n return lottiePath.json;\n }\n let primaryColor = Color(ThemeVariables.INSTANCE.primaryColor);\n let colors = [this.toRgbArray(primaryColor),\n this.toRgbArray(primaryColor.darken(0.2)),\n this.toRgbArray(primaryColor.darken(0.4)),\n this.toRgbArray(primaryColor.darken(0.6)),\n this.toRgbArray(primaryColor.darken(0.8))];\n return this.recursiveSearch(lottiePath.json, lottiePath.loader == 'circleSpinner' ? [colors[0]] : colors);\n }\n\n private prepareLottie(props: any, loaderConfig: any) {\n let Lottie = Platform.OS == 'web' ? require('react-lottie-player') : null;\n Lottie = Lottie?.default || Lottie;\n const animationSource = this.addClasstoLottie(props.lottie, loaderConfig?.inheritThemePrimary);\n return (\n Platform.OS == 'web' ? <Lottie animationData={animationSource} loop={true} play={true} style={this.styles.lottie} /> : <LottieView\n {...this.getTestProps('loader')}\n source={animationSource}\n resizeMode='contain'\n autoPlay={true}\n loop={true}\n style={this.styles.lottie}\n />\n )\n }\n\n renderWidget(props: WmSpinnerProps) {\n return (\n <UIPreferencesConsumer>\n {(preferences: UI_PREFERENCES) => {\n const loaderConfig = preferences.appLoader;\n return (\n <View\n style={this.styles.root}\n onLayout={(event) => this.handleLayout(event)}\n >\n {this._background}\n {props.lottie ? this.prepareLottie(props, loaderConfig) : props.image ? this.prepareImage(props) : this.prepareIcon(props)}\n {props.caption ? (<Text {...this.getTestPropsForLabel()} style={this.styles.text}>{props.caption}</Text>) : null}\n </View>)\n }}\n </UIPreferencesConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AAEpG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,MAAM,MAAM,mEAAmE;AACtF,OAAOC,SAAS,MAAM,yEAAyE;AAC/F,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,cAAc,MAAM,qDAAqD;AAChF,SAASC,qBAAqB,QAAwB,0DAA0D;AAChH,OAAO,MAAMC,cAAc,SAASR,kBAAkB,CAAiB;AAIvE,eAAe,MAAMS,SAAS,SAASV,aAAa,CAAkD;EAEpGW,WAAWA,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,CAAC;IAACW,eAAA,0BAiB1B,CAACC,GAAQ,EAAEC,MAAW,KAAK;MACnDD,GAAG,IAAIE,MAAM,CAACC,IAAI,CAACH,GAAG,CAAC,CAACI,OAAO,CAACC,GAAG,IAAI;QACnC,IAAIC,KAAK,GAAGN,GAAG,CAACK,GAAG,CAAC;QACpB,IAAIE,GAAG,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAGT,MAAM,CAACU,MAAM,CAAE,GAAGV,MAAM,CAACU,MAAM,CAAC;QAC1E,IAAIN,GAAG,IAAI,IAAI,KAAKC,KAAK,CAACM,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,OAAO,CAAC,IAAIP,KAAK,CAACM,WAAW,CAAC,CAAC,CAACC,QAA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S;MAC1C,oBACE/E,KAAA,CAAAoC,aAAA,CAAClC,IAAI;QACHqE,KAAK,EAAE,IAAI,CAAChC,MAAM,CAACyC,IAAK;QACxBC,QAAQ,EAAGC,KAAK,IAAK,IAAI,CAACC,YAAY,CAACD,KAAK;MAAE,GAE7C,IAAI,CAACE,WAAW,EAChBnE,KAAK,CAACkD,MAAM,GAAG,IAAI,CAACR,aAAa,CAAC1C,KAAK,EAAE2C,YAAY,CAAC,GAAG3C,KAAK,CAAC2B,KAAK,GAAG,IAAI,CAACD,YAAY,CAAC1B,KAAK,CAAC,GAAG,IAAI,CAACkB,WAAW,CAAClB,KAAK,CAAC,EACzHA,KAAK,CAACoE,OAAO,gBAAIrF,KAAA,CAAAoC,aAAA,CAACnC,IAAI,EAAAuE,QAAA,KAAK,IAAI,CAACc,oBAAoB,CAAC,CAAC;QAAEf,KAAK,EAAE,IAAI,CAAChC,MAAM,CAACgD;MAAK,IAAEtE,KAAK,CAACoE,OAAc,CAAC,GAAI,IACxG,CAAC;IACT,CACqB,CAAC;EAE5B;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Text","View","Platform","Color","BaseComponent","BaseComponentState","WmSpinnerProps","DEFAULT_CLASS","WmIcon","WmPicture","LottieView","ThemeVariables","UIPreferencesConsumer","WmSpinnerState","WmSpinner","constructor","props","_defineProperty","obj","colors","Object","keys","forEach","key","value","ind","Math","floor","random","length","toLowerCase","includes","shape","recursiveSearch","prepareIcon","createElement","id","getTestId","styles","icon","iconclass","iconurl","iconsize","prepareImage","image","picturesource","toRgbArray","color","red","green","blue","addClasstoLottie","lottiePath","inheritThemePrimary","json","primaryColor","INSTANCE","darken","loader","prepareLottie","loaderConfig","_Lottie","Lottie","OS","require","default","animationSource","lottie","animationData","loop","play","style","_extends","getTestProps","source","resizeMode","autoPlay","renderWidget","preferences","appLoader","root","onLayout","event","handleLayout","_background","caption","getTestPropsForLabel","text"],"sources":["spinner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, Platform } from 'react-native';\nimport Color from \"color\";\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nimport WmSpinnerProps from './spinner.props';\nimport { DEFAULT_CLASS, WmSpinnerStyles } from './spinner.styles';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';\nimport LottieView from 'lottie-react-native';\nimport ThemeVariables from '@wavemaker-ai/app-rn-runtime/styles/theme.variables';\nimport { UIPreferencesConsumer, UI_PREFERENCES } from \"@wavemaker-ai/app-rn-runtime/core/ui-preferences.context\";\nexport class WmSpinnerState extends BaseComponentState<WmSpinnerProps> {\n\n}\n\nexport default class WmSpinner extends BaseComponent<WmSpinnerProps, WmSpinnerState, WmSpinnerStyles> {\n\n constructor(props: WmSpinnerProps) {\n super(props, DEFAULT_CLASS, new WmSpinnerProps());\n }\n\n private prepareIcon(props: any) {\n return (<WmIcon\n id={this.getTestId('icon')}\n styles={this.styles.icon}\n iconclass={props.iconclass + ' fa-spin'} iconurl={props.iconurl} iconsize={props.iconsize}></WmIcon>);\n }\n\n private prepareImage(props: any) {\n return (<WmPicture\n id={this.getTestId('picture')}\n styles={this.styles.image}\n picturesource={props.image}></WmPicture>);\n }\n\n private recursiveSearch = (obj: any, colors: any) => {\n obj && Object.keys(obj).forEach(key => {\n let value = obj[key];\n let ind = Math.floor(Math.random() * (0 - colors.length ) + colors.length);\n if (key == \"nm\" && (value.toLowerCase().includes('fill ') || value.toLowerCase().includes('stroke '))) {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]\n && (obj[\"c\"][\"k\"].length == 4\n || (obj[\"c\"][\"k\"].length ==3\n && typeof obj[\"c\"][\"k\"][0] == 'number'))) {\n obj[\"c\"][\"k\"] = colors[ind];\n }\n else {\n if (obj[\"c\"] && obj[\"c\"][\"k\"]){\n for (let shape in obj[\"c\"][\"k\"]) {\n if(obj[\"c\"][\"k\"][shape] && obj[\"c\"][\"k\"][shape][\"s\"]){\n obj[\"c\"][\"k\"][shape][\"s\"] = colors[ind];\n }\n }\n }\n }\n } else if (typeof value === 'object') {\n this.recursiveSearch(value, colors);\n }\n });\n return obj;\n };\n\n private toRgbArray(color: Color) {\n return [\n color.red()/255,\n color.green()/255,\n color.blue()/255,\n 1\n ]\n }\n\n private addClasstoLottie(lottiePath: any, inheritThemePrimary: boolean) {\n if (inheritThemePrimary === false){\n return lottiePath.json;\n }\n let primaryColor = Color(ThemeVariables.INSTANCE.primaryColor);\n let colors = [this.toRgbArray(primaryColor),\n this.toRgbArray(primaryColor.darken(0.2)),\n this.toRgbArray(primaryColor.darken(0.4)),\n this.toRgbArray(primaryColor.darken(0.6)),\n this.toRgbArray(primaryColor.darken(0.8))];\n return this.recursiveSearch(lottiePath.json, lottiePath.loader == 'circleSpinner' ? [colors[0]] : colors);\n }\n\n private prepareLottie(props: any, loaderConfig: any) {\n let Lottie = Platform.OS == 'web' ? require('react-lottie-player') : null;\n Lottie = Lottie?.default || Lottie;\n const animationSource = this.addClasstoLottie(props.lottie, loaderConfig?.inheritThemePrimary);\n return (\n Platform.OS == 'web' ? <Lottie animationData={animationSource} loop={true} play={true} style={this.styles.lottie} /> : <LottieView\n {...this.getTestProps('loader')}\n source={animationSource}\n resizeMode='contain'\n autoPlay={true}\n loop={true}\n style={this.styles.lottie}\n />\n )\n }\n\n renderWidget(props: WmSpinnerProps) {\n return (\n <UIPreferencesConsumer>\n {(preferences: UI_PREFERENCES) => {\n const loaderConfig = preferences.appLoader;\n return (\n <View\n style={this.styles.root}\n onLayout={(event) => this.handleLayout(event)}\n >\n {this._background}\n {props.lottie ? this.prepareLottie(props, loaderConfig) : props.image ? this.prepareImage(props) : this.prepareIcon(props)}\n {props.caption ? (<Text {...this.getTestPropsForLabel()} style={this.styles.text}>{props.caption}</Text>) : null}\n </View>)\n }}\n </UIPreferencesConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAO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CAAC0C,IAAK;QACxBC,QAAQ,EAAGC,KAAK,IAAK,IAAI,CAACC,YAAY,CAACD,KAAK;MAAE,GAE7C,IAAI,CAACE,WAAW,EAChBpE,KAAK,CAACmD,MAAM,GAAG,IAAI,CAACR,aAAa,CAAC3C,KAAK,EAAE4C,YAAY,CAAC,GAAG5C,KAAK,CAAC4B,KAAK,GAAG,IAAI,CAACD,YAAY,CAAC3B,KAAK,CAAC,GAAG,IAAI,CAACkB,WAAW,CAAClB,KAAK,CAAC,EACzHA,KAAK,CAACqE,OAAO,gBAAItF,KAAA,CAAAoC,aAAA,CAACnC,IAAI,EAAAwE,QAAA,KAAK,IAAI,CAACc,oBAAoB,CAAC,CAAC;QAAEf,KAAK,EAAE,IAAI,CAACjC,MAAM,CAACiD;MAAK,IAAEvE,KAAK,CAACqE,OAAc,CAAC,GAAI,IACxG,CAAC;IACT,CACqB,CAAC;EAE5B;AACF","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ export default class WmSpinnerProps extends BaseProps {
|
|
|
7
7
|
super(...args);
|
|
8
8
|
_defineProperty(this, "caption", 'Loading...');
|
|
9
9
|
_defineProperty(this, "iconclass", 'fa fa-circle-o-notch fa-spin');
|
|
10
|
+
_defineProperty(this, "iconurl", null);
|
|
10
11
|
_defineProperty(this, "iconsize", 0);
|
|
11
12
|
_defineProperty(this, "image", null);
|
|
12
13
|
_defineProperty(this, "imageheight", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmSpinnerProps","constructor","args","_defineProperty"],"sources":["spinner.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nexport default class WmSpinnerProps extends BaseProps {\n caption: string = 'Loading...';\n iconclass?: string = 'fa fa-circle-o-notch fa-spin';\n iconsize? = 0;\n image?: string = null as any;\n imageheight?: string = null as any;\n imagewidth?: number = 20;\n lottie?: string = null as any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAClC,YAAY;IAAAA,eAAA,oBACT,8BAA8B;IAAAA,eAAA,
|
|
1
|
+
{"version":3,"names":["BaseProps","WmSpinnerProps","constructor","args","_defineProperty"],"sources":["spinner.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nexport default class WmSpinnerProps extends BaseProps {\n caption: string = 'Loading...';\n iconclass?: string = 'fa fa-circle-o-notch fa-spin';\n iconurl?: string = null as any;\n iconsize? = 0;\n image?: string = null as any;\n imageheight?: string = null as any;\n imagewidth?: number = 20;\n lottie?: string = null as any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAClC,YAAY;IAAAA,eAAA,oBACT,8BAA8B;IAAAA,eAAA,kBAChC,IAAI;IAAAA,eAAA,mBACX,CAAC;IAAAA,eAAA,gBACI,IAAI;IAAAA,eAAA,sBACE,IAAI;IAAAA,eAAA,qBACL,EAAE;IAAAA,eAAA,iBACN,IAAI;EAAA;AACxB","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ import { DEFAULT_CLASS } from './area-chart.styles';
|
|
|
10
10
|
import { BaseChartComponent, BaseChartComponentState } from "@wavemaker-ai/app-rn-runtime/components/chart/basechart.component";
|
|
11
11
|
import WmIcon from "@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component";
|
|
12
12
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';
|
|
13
|
+
import { parseDimension } from '@wavemaker-ai/app-rn-runtime/core/utils';
|
|
13
14
|
export class WmAreaChartState extends BaseChartComponentState {
|
|
14
15
|
constructor(...args) {
|
|
15
16
|
super(...args);
|
|
@@ -82,21 +83,26 @@ export default class WmAreaChart extends BaseChartComponent {
|
|
|
82
83
|
const minDomain = this.getMinDomain();
|
|
83
84
|
const series = ((_this$state$colors = this.state.colors) !== null && _this$state$colors !== void 0 && _this$state$colors.length ? this.state.colors : ['#000']).map(color => ({
|
|
84
85
|
color,
|
|
85
|
-
lineWidth: props.linethickness
|
|
86
|
+
lineWidth: parseDimension(props.linethickness)
|
|
86
87
|
}));
|
|
87
88
|
const symbol = this.getSeriesSymbol(props.highlightpoints, props.ticksymbol);
|
|
89
|
+
const {
|
|
90
|
+
height: rootHeight,
|
|
91
|
+
...wrapperStyle
|
|
92
|
+
} = this.styles.root;
|
|
88
93
|
return /*#__PURE__*/React.createElement(View, _extends({}, getAccessibilityProps(AccessibilityWidgetType.LINECHART, props), {
|
|
89
|
-
style:
|
|
94
|
+
style: wrapperStyle,
|
|
90
95
|
onLayout: this.onViewLayoutChange.bind(this),
|
|
91
96
|
key: `${props.title}_area_chart`
|
|
92
|
-
}), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass ? /*#__PURE__*/React.createElement(View, {
|
|
97
|
+
}), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(View, {
|
|
93
98
|
testID: "title-icon-container",
|
|
94
99
|
style: {
|
|
95
100
|
flexDirection: 'row',
|
|
96
101
|
alignItems: 'center'
|
|
97
102
|
}
|
|
98
|
-
}, props.iconclass ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
103
|
+
}, props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
99
104
|
iconclass: props.iconclass,
|
|
105
|
+
iconurl: props.iconurl,
|
|
100
106
|
styles: this.styles.icon
|
|
101
107
|
}) : null, props.title ? /*#__PURE__*/React.createElement(Text, {
|
|
102
108
|
style: this.styles.title
|
|
@@ -136,8 +142,8 @@ export default class WmAreaChart extends BaseChartComponent {
|
|
|
136
142
|
showYAxisSplitLines: !props.hidegridyaxis,
|
|
137
143
|
xAxisLabel: this.state.xLabel || '',
|
|
138
144
|
yAxisLabel: this.state.yLabel || '',
|
|
139
|
-
xAxisTickLabelFormatter: this.getXAxisTickLabelFormatter(),
|
|
140
|
-
yAxisTickLabelFormatter: this.getYAxisTickLabelFormatter(),
|
|
145
|
+
xAxisTickLabelFormatter: props.showxaxis !== false ? this.getXAxisTickLabelFormatter() : undefined,
|
|
146
|
+
yAxisTickLabelFormatter: props.showyaxis !== false ? this.getYAxisTickLabelFormatter() : undefined,
|
|
141
147
|
showLegend: showLegend,
|
|
142
148
|
legendPosition: legendPosition,
|
|
143
149
|
tooltip: props.tooltips ? this.hasCustomTooltip ? 'none' : (_props$tooltip = props.tooltip) !== null && _props$tooltip !== void 0 ? _props$tooltip : 'card' : 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","AreaChart","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmIcon","AccessibilityWidgetType","getAccessibilityProps","WmAreaChartState","constructor","args","_defineProperty","getAreaType","interpolation","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","handleLayout","updateState","chartWidth","event","state","dataset","dataIndex","y","seriesIndex","selectedItem","selectedChartItem","series","x","_dataObj","index","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$state$colors","_props$tooltip","data","length","chartData","map","i","name","yAxis","pt","type","showLegend","showlegend","legendPosition","includes","minDomain","getMinDomain","colors","color","lineWidth","linethickness","symbol","getSeriesSymbol","highlightpoints","ticksymbol","createElement","_extends","LINECHART","style","styles","root","onLayout","onViewLayoutChange","bind","key","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","ref","viewRef","screenWidth","height","theme","getChartTheme","step","stepposition","stackNormalize","stacknormalize","symbolSize","symbolsize","areaFill","areafill","areaOpacity","areaopacity","minY","minX","maxX","chartMaxX","grid","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","showXAxis","showxaxis","showXAxisTicks","showxaxisticks","showYAxis","showyaxis","showYAxisTicks","showyaxisticks","showXAxisSplitLines","hidegridxaxis","showYAxisSplitLines","hidegridyaxis","xAxisLabel","xLabel","yAxisLabel","yLabel","xAxisTickLabelFormatter","getXAxisTickLabelFormatter","yAxisTickLabelFormatter","getYAxisTickLabelFormatter","tooltip","tooltips","hasCustomTooltip","renderTooltip","getRenderTooltip","showHighlighter","showhighlighter","onSelect","intervalX","intervalx","intervalY","intervaly"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { AreaChart, CartesianChartSelectEvent } from '@wavemaker/react-native-echarts';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker-ai/app-rn-runtime/components/chart/basechart.component\";\nimport WmIcon from \"@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport isEmpty from 'lodash-es/isEmpty';\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\n/** Maps Victory interpolation strings to ECharts AreaChart curve types. */\nconst getAreaType = (interpolation: string): 'default' | 'smooth' | 'step' => {\n if (interpolation === 'cardinal') return 'smooth';\n if (interpolation === 'step') return 'step';\n return 'default'; // 'linear' and anything else\n};\n\n\n// Migrated from victory-native <VictoryChart> + <VictoryArea> → <AreaChart>\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n\n this.handleLayout(e);\n\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState);\n }\n\n onSelect = (event: CartesianChartSelectEvent): void => {\n if (!this.state.props.dataset) return;\n const { dataIndex, y, seriesIndex } = event;\n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = [\n { series: seriesIndex, x: dataIndex, y, _dataObj: selectedItem },\n dataIndex,\n ];\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as WmAreaChartState);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\n}\n\n renderWidget(props: WmAreaChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n const chartData = this.state.data.map((series: any[], i: number) => ({\n name: this.state.yAxis[i],\n data: series.map((pt: { x: number; y: number }) => pt.y),\n }));\n\n const type = getAreaType(props.interpolation);\n // step sub-mode: only relevant when curve type resolves to 'step'\n // const step: 'start' | 'middle' | 'end' | false =\n // type === 'step'\n // ? props.step === false\n // ? false\n // : (props.step ?? 'start')\n // : false;\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n const minDomain = this.getMinDomain();\n const series = (this.state.colors?.length ? this.state.colors : ['#000']).map((color: string) => ({\n color,\n lineWidth: props.linethickness,\n }));\n const symbol = this.getSeriesSymbol(props.highlightpoints, props.ticksymbol);\n\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n key={`${props.title}_area_chart`}\n >\n <View>\n { (props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null }\n </View>\n ) : null }\n { props.subheading? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text> ) : null }\n </View>\n {this.state.chartWidth ?\n (\n <View ref={this.viewRef}>\n <AreaChart\n data={chartData}\n width={this.state.chartWidth || this.screenWidth}\n height={this.styles.root.height as number}\n colors={this.state.colors}\n theme={this.getChartTheme(false, series)}\n type={type}\n step={props.stepposition}\n stackNormalize={props.stacknormalize}\n symbol={symbol}\n symbolSize={props.symbolsize}\n areaFill={props.areafill}\n areaOpacity={props.areaopacity}\n minY={minDomain.y}\n // maxY={this.state.chartMaxY}\n minX={minDomain.x}\n maxX={this.state.chartMaxX}\n grid={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: this.isRTL ? props.offsetright : props.offsetleft,\n right: this.isRTL ? props.offsetleft : props.offsetright,\n }}\n showXAxis={props.showxaxis !== false}\n showXAxisTicks={props.showxaxisticks}\n showYAxis={props.showyaxis !== false}\n showYAxisTicks={props.showyaxisticks}\n showXAxisSplitLines={!props.hidegridxaxis}\n showYAxisSplitLines={!props.hidegridyaxis}\n xAxisLabel={this.state.xLabel || ''}\n yAxisLabel={this.state.yLabel || ''}\n xAxisTickLabelFormatter={this.getXAxisTickLabelFormatter()}\n yAxisTickLabelFormatter={this.getYAxisTickLabelFormatter()}\n showLegend={showLegend}\n legendPosition={legendPosition}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n renderTooltip={this.getRenderTooltip()}\n showHighlighter={this.props.showhighlighter}\n onSelect={this.onSelect}\n intervalX={props.intervalx}\n intervalY={props.intervaly}\n />\n </View>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,SAAS,QAAmC,iCAAiC;AACtF,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,u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B,CACG,CAAC,GACL,IACA,CAAC;EAEX;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","View","Text","AreaChart","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmIcon","AccessibilityWidgetType","getAccessibilityProps","parseDimension","WmAreaChartState","constructor","args","_defineProperty","getAreaType","interpolation","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","handleLayout","updateState","chartWidth","event","state","dataset","dataIndex","y","seriesIndex","selectedItem","selectedChartItem","series","x","_dataObj","index","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$state$colors","_props$tooltip","data","length","chartData","map","i","name","yAxis","pt","type","showLegend","showlegend","legendPosition","includes","minDomain","getMinDomain","colors","color","lineWidth","linethickness","symbol","getSeriesSymbol","highlightpoints","ticksymbol","height","rootHeight","wrapperStyle","styles","root","createElement","_extends","LINECHART","style","onLayout","onViewLayoutChange","bind","key","title","iconclass","iconurl","testID","flexDirection","alignItems","icon","subheading","subHeading","ref","viewRef","screenWidth","theme","getChartTheme","step","stepposition","stackNormalize","stacknormalize","symbolSize","symbolsize","areaFill","areafill","areaOpacity","areaopacity","minY","minX","maxX","chartMaxX","grid","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","showXAxis","showxaxis","showXAxisTicks","showxaxisticks","showYAxis","showyaxis","showYAxisTicks","showyaxisticks","showXAxisSplitLines","hidegridxaxis","showYAxisSplitLines","hidegridyaxis","xAxisLabel","xLabel","yAxisLabel","yLabel","xAxisTickLabelFormatter","getXAxisTickLabelFormatter","undefined","yAxisTickLabelFormatter","getYAxisTickLabelFormatter","tooltip","tooltips","hasCustomTooltip","renderTooltip","getRenderTooltip","showHighlighter","showhighlighter","onSelect","intervalX","intervalx","intervalY","intervaly"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { AreaChart, CartesianChartSelectEvent } from '@wavemaker/react-native-echarts';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker-ai/app-rn-runtime/components/chart/basechart.component\";\nimport WmIcon from \"@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component\";\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { parseDimension } from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport isEmpty from 'lodash-es/isEmpty';\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\n/** Maps Victory interpolation strings to ECharts AreaChart curve types. */\nconst getAreaType = (interpolation: string): 'default' | 'smooth' | 'step' => {\n if (interpolation === 'cardinal') return 'smooth';\n if (interpolation === 'step') return 'step';\n return 'default'; // 'linear' and anything else\n};\n\n\n// Migrated from victory-native <VictoryChart> + <VictoryArea> → <AreaChart>\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n\n this.handleLayout(e);\n\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState);\n }\n\n onSelect = (event: CartesianChartSelectEvent): void => {\n if (!this.state.props.dataset) return;\n const { dataIndex, y, seriesIndex } = event;\n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = [\n { series: seriesIndex, x: dataIndex, y, _dataObj: selectedItem },\n dataIndex,\n ];\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as WmAreaChartState);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\n}\n\n renderWidget(props: WmAreaChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n const chartData = this.state.data.map((series: any[], i: number) => ({\n name: this.state.yAxis[i],\n data: series.map((pt: { x: number; y: number }) => pt.y),\n }));\n\n const type = getAreaType(props.interpolation);\n // step sub-mode: only relevant when curve type resolves to 'step'\n // const step: 'start' | 'middle' | 'end' | false =\n // type === 'step'\n // ? props.step === false\n // ? false\n // : (props.step ?? 'start')\n // : false;\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n const minDomain = this.getMinDomain();\n const series = (this.state.colors?.length ? this.state.colors : ['#000']).map((color: string) => ({\n color,\n lineWidth: parseDimension(props.linethickness),\n }));\n const symbol = this.getSeriesSymbol(props.highlightpoints, props.ticksymbol);\n\n const { height: rootHeight, ...wrapperStyle } = this.styles.root as any;\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={wrapperStyle}\n onLayout={this.onViewLayoutChange.bind(this)}\n key={`${props.title}_area_chart`}\n >\n <View>\n { (props.title || props.iconclass || props.iconurl) ? (\n <View testID=\"title-icon-container\" style={{flexDirection: 'row', alignItems: 'center'}}>\n {(props.iconclass || props.iconurl) ? (<WmIcon iconclass={props.iconclass} iconurl={props.iconurl} styles={this.styles.icon}></WmIcon>) : null }\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null }\n </View>\n ) : null }\n { props.subheading? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text> ) : null }\n </View>\n {this.state.chartWidth ?\n (\n <View ref={this.viewRef}>\n <AreaChart\n data={chartData}\n width={this.state.chartWidth || this.screenWidth}\n height={this.styles.root.height as number}\n colors={this.state.colors}\n theme={this.getChartTheme(false, series)}\n type={type}\n step={props.stepposition}\n stackNormalize={props.stacknormalize}\n symbol={symbol}\n symbolSize={props.symbolsize}\n areaFill={props.areafill}\n areaOpacity={props.areaopacity}\n minY={minDomain.y}\n // maxY={this.state.chartMaxY}\n minX={minDomain.x}\n maxX={this.state.chartMaxX}\n grid={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: this.isRTL ? props.offsetright : props.offsetleft,\n right: this.isRTL ? props.offsetleft : props.offsetright,\n }}\n showXAxis={props.showxaxis !== false}\n showXAxisTicks={props.showxaxisticks}\n showYAxis={props.showyaxis !== false}\n showYAxisTicks={props.showyaxisticks}\n showXAxisSplitLines={!props.hidegridxaxis}\n showYAxisSplitLines={!props.hidegridyaxis}\n xAxisLabel={this.state.xLabel || ''}\n yAxisLabel={this.state.yLabel || ''}\n xAxisTickLabelFormatter={props.showxaxis !== false ? this.getXAxisTickLabelFormatter() : undefined}\n yAxisTickLabelFormatter={props.showyaxis !== false ? this.getYAxisTickLabelFormatter() : undefined}\n showLegend={showLegend}\n legendPosition={legendPosition}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n renderTooltip={this.getRenderTooltip()}\n showHighlighter={this.props.showhighlighter}\n onSelect={this.onSelect}\n intervalX={props.intervalx}\n intervalY={props.intervaly}\n />\n </View>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,SAAS,QAAmC,iCAAiC;AACtF,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,mEAAmE;AAC1E,OAAOC,MAAM,MAAM,mEAAmE;AACtF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAChH,SAASC,cAAc,QAAQ,yCAAyC;AAGxE,OAAO,MAAMC,gBAAgB,SAASL,uBAAuB,CAAmB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBACjE,CAAC;EAAA;AAChB;;AA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MAC3BC,SAAS,EAAEpI,KAAK,CAACqI;IAAU,CAC5B,CACG,CAAC,GACL,IACA,CAAC;EAEX;AACF","ignoreList":[]}
|
|
@@ -61,19 +61,26 @@ export default class WmBarChart extends BaseChartComponent {
|
|
|
61
61
|
const series = ((_this$state$colors = this.state.colors) !== null && _this$state$colors !== void 0 && _this$state$colors.length ? this.state.colors : ['#000']).map(color => ({
|
|
62
62
|
color
|
|
63
63
|
}));
|
|
64
|
-
const
|
|
65
|
-
const
|
|
64
|
+
const showXAxis = isHorizontal ? props.showyaxis : props.showxaxis;
|
|
65
|
+
const showYAxis = isHorizontal ? props.showxaxis : props.showyaxis;
|
|
66
|
+
const xAxisTickLabelFormatter = showXAxis === false ? undefined : isHorizontal ? this.getYAxisTickLabelFormatter() : this.getXAxisTickLabelFormatter();
|
|
67
|
+
const yAxisTickLabelFormatter = showYAxis === false ? undefined : isHorizontal ? this.getXAxisTickLabelFormatter() : this.getYAxisTickLabelFormatter();
|
|
68
|
+
const {
|
|
69
|
+
height: rootHeight,
|
|
70
|
+
...wrapperStyle
|
|
71
|
+
} = this.styles.root;
|
|
66
72
|
return /*#__PURE__*/React.createElement(View, _extends({}, getAccessibilityProps(AccessibilityWidgetType.LINECHART, props), {
|
|
67
|
-
style:
|
|
73
|
+
style: wrapperStyle,
|
|
68
74
|
onLayout: this.onViewLayoutChange.bind(this)
|
|
69
|
-
}), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass ? /*#__PURE__*/React.createElement(View, {
|
|
75
|
+
}), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(View, {
|
|
70
76
|
testID: "title-icon-container",
|
|
71
77
|
style: {
|
|
72
78
|
flexDirection: 'row',
|
|
73
79
|
alignItems: 'center'
|
|
74
80
|
}
|
|
75
|
-
}, props.iconclass ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
81
|
+
}, props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
76
82
|
iconclass: props.iconclass,
|
|
83
|
+
iconurl: props.iconurl,
|
|
77
84
|
styles: this.styles.icon
|
|
78
85
|
}) : null, props.title ? /*#__PURE__*/React.createElement(Text, {
|
|
79
86
|
style: this.styles.title
|
|
@@ -102,9 +109,9 @@ export default class WmBarChart extends BaseChartComponent {
|
|
|
102
109
|
left: this.isRTL ? props.offsetright : props.offsetleft,
|
|
103
110
|
right: this.isRTL ? props.offsetleft : props.offsetright
|
|
104
111
|
},
|
|
105
|
-
showXAxis:
|
|
112
|
+
showXAxis: showXAxis,
|
|
106
113
|
showXAxisTicks: isHorizontal ? props.showyaxisticks : props.showxaxisticks,
|
|
107
|
-
showYAxis:
|
|
114
|
+
showYAxis: showYAxis,
|
|
108
115
|
showYAxisTicks: isHorizontal ? props.showxaxisticks : props.showyaxisticks,
|
|
109
116
|
showXAxisSplitLines: isHorizontal ? !props.hidegridyaxis : !props.hidegridxaxis,
|
|
110
117
|
showYAxisSplitLines: isHorizontal ? !props.hidegridxaxis : !props.hidegridyaxis,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","ColumnChart","AccessibilityWidgetType","getAccessibilityProps","BaseChartComponent","BaseChartComponentState","WmBarChartProps","DEFAULT_CLASS","WmIcon","WmBarChartState","WmBarChart","constructor","props","_defineProperty","event","viewRef","current","state","dataset","dataIndex","y","seriesIndex","selectedItem","selectedChartItem","series","x","_dataObj","updateState","index","invokeEventCallback","proxy","labelFn","data","abbreviateNumber","datum","renderWidget","_this$state$data","_this$state$colors","_props$tooltip","length","chartData","map","i","name","yAxis","pt","showLegend","showlegend","legendPosition","includes","minDomain","getMinDomain","isHorizontal","horizontal","colors","color","xAxisTickLabelFormatter","getYAxisTickLabelFormatter","getXAxisTickLabelFormatter","yAxisTickLabelFormatter","createElement","_extends","LINECHART","style","styles","root","onLayout","onViewLayoutChange","bind","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","chartWidth","ref","width","screenWidth","height","theme","getChartTheme","stack","viewtype","stackNormalize","stacknormalize","cornerRadius","bar","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","barOutsideLabelFormatter","showvalues","value","String","undefined","minY","maxY","chartMaxY","minX","maxX","chartMaxX","grid","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","showXAxis","showyaxis","showxaxis","showXAxisTicks","showyaxisticks","showxaxisticks","showYAxis","showYAxisTicks","showXAxisSplitLines","hidegridyaxis","hidegridxaxis","showYAxisSplitLines","xAxisLabel","yLabel","xLabel","yAxisLabel","tooltip","tooltips","hasCustomTooltip","renderTooltip","getRenderTooltip","showHighlighter","showhighlighter","onSelect","intervalX","intervaly","intervalx","intervalY"],"sources":["bar-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\nimport { ColumnChart, CartesianChartSelectEvent, AreaChartAxisTooltipParams } from '@wavemaker/react-native-echarts';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker-ai/app-rn-runtime/components/chart/basechart.component\";\nimport WmBarChartProps from './bar-chart.props';\nimport { DEFAULT_CLASS, WmBarChartStyles } from './bar-chart.styles';\nimport WmIcon from \"@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component\";\nimport isEmpty from 'lodash-es/isEmpty';\n\nexport class WmBarChartState extends BaseChartComponentState<WmBarChartProps> {}\n\nexport default class WmBarChart extends BaseChartComponent<WmBarChartProps, WmBarChartState, WmBarChartStyles> {\n\n constructor(props: WmBarChartProps) {\n super(props, DEFAULT_CLASS, new WmBarChartProps(), new WmBarChartState());\n }\n\n labelFn(data: any): string | number | string[] | number[] | null {\n return this.abbreviateNumber(data.datum.y);\n }\n\n\n onSelect = (event: CartesianChartSelectEvent): void => {\n if (!this.viewRef.current) return;\n if (!this.state.props.dataset) return;\n const { dataIndex, y, seriesIndex } = event;\n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = [\n { series: seriesIndex, x: dataIndex, y, _dataObj: selectedItem },\n dataIndex,\n ];\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as WmBarChartState);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\n}\n\n renderWidget(props: WmBarChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n\n const chartData = this.state.data.map((series: any[], i: number) => ({\n name: this.state.yAxis[i],\n data: series.map((pt: { x: number; y: number }) => pt.y),\n }));\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n const minDomain = this.getMinDomain();\n\n // ColumnChart swaps category/value axes when horizontal=true. WaveMaker x-axis props\n // refer to categories (xaxisdatakey) and y-axis props refer to values (yaxisdatakey).\n const isHorizontal = !!props.horizontal;\n const series = (this.state.colors?.length ? this.state.colors : ['#000']).map((color: string) => ({\n color,\n }));\n const xAxisTickLabelFormatter = isHorizontal\n ? this.getYAxisTickLabelFormatter()\n : this.getXAxisTickLabelFormatter();\n const yAxisTickLabelFormatter = isHorizontal\n ? this.getXAxisTickLabelFormatter()\n : this.getYAxisTickLabelFormatter();\n\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n <View>\n {(props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{ flexDirection: 'row', alignItems: 'center' }}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon} />) : null}\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null}\n </View>\n ) : null}\n {props.subheading ? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n ) : null}\n </View>\n {this.state.chartWidth ? (\n <View ref={this.viewRef}>\n <ColumnChart\n data={chartData}\n width={this.state.chartWidth || this.screenWidth}\n height={this.styles.root.height as number}\n colors={this.state.colors}\n theme={this.getChartTheme(isHorizontal, series)}\n horizontal={props.horizontal}\n stack={props.viewtype === 'Stacked' ? 'total' : false}\n stackNormalize={props.stacknormalize}\n cornerRadius={[\n this.styles.bar.borderTopLeftRadius,\n this.styles.bar.borderTopRightRadius,\n this.styles.bar.borderBottomRightRadius,\n this.styles.bar.borderBottomLeftRadius,\n ]}\n barOutsideLabelFormatter={props.showvalues\n ? (value: number) => String(this.abbreviateNumber(value))\n : undefined}\n minY={minDomain.y}\n maxY={this.state.chartMaxY}\n minX={minDomain.x}\n maxX={this.state.chartMaxX}\n grid={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: this.isRTL ? props.offsetright : props.offsetleft,\n right: this.isRTL ? props.offsetleft : props.offsetright,\n }}\n showXAxis={isHorizontal ? props.showyaxis : props.showxaxis}\n showXAxisTicks={isHorizontal ? props.showyaxisticks : props.showxaxisticks}\n showYAxis={isHorizontal ? props.showxaxis : props.showyaxis}\n showYAxisTicks={isHorizontal ? props.showxaxisticks : props.showyaxisticks}\n showXAxisSplitLines={isHorizontal ? !props.hidegridyaxis : !props.hidegridxaxis}\n showYAxisSplitLines={isHorizontal ? !props.hidegridxaxis : !props.hidegridyaxis}\n xAxisLabel={isHorizontal ? (this.state.yLabel || '') : (this.state.xLabel || '')}\n yAxisLabel={isHorizontal ? (this.state.xLabel || '') : (this.state.yLabel || '')}\n xAxisTickLabelFormatter={xAxisTickLabelFormatter}\n yAxisTickLabelFormatter={yAxisTickLabelFormatter}\n showLegend={showLegend}\n legendPosition={legendPosition}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n renderTooltip={this.getRenderTooltip()}\n showHighlighter={props.showhighlighter}\n onSelect={this.onSelect}\n intervalX={isHorizontal ? props.intervaly : props.intervalx}\n intervalY={isHorizontal ? props.intervalx :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AChH,KAAK,CAAC+G,MAAM,IAAI,EAAI;MACjFxE,uBAAuB,EAAEA,uBAAwB;MACjDG,uBAAuB,EAAEA,uBAAwB;MACjDb,UAAU,EAAEA,UAAW;MACvBE,cAAc,EAAEA,cAAe;MAC/BmF,OAAO,EAAEvH,KAAK,CAACwH,QAAQ,GAAI,IAAI,CAACC,gBAAgB,GAAG,MAAM,IAAA/F,cAAA,GAAI1B,KAAK,CAACuH,OAAO,cAAA7F,cAAA,cAAAA,cAAA,GAAI,MAAO,GAAI,MAAO;MAChGgG,aAAa,EAAE,IAAI,CAACC,gBAAgB,CAAC,CAAE;MACvCC,eAAe,EAAE5H,KAAK,CAAC6H,eAAgB;MACvCC,QAAQ,EAAE,IAAI,CAACA,QAAS;MACxBC,SAAS,EAAEvF,YAAY,GAAGxC,KAAK,CAACgI,SAAS,GAAGhI,KAAK,CAACiI,SAAU;MAC5DC,SAAS,EAAE1F,YAAY,GAAGxC,KAAK,CAACiI,SAAS,GAAGjI,KAAK,CAACgI;IAAU,CAC7D,CACG,CAAC,GACL,IACA,CAAC;EAEX;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","View","Text","ColumnChart","AccessibilityWidgetType","getAccessibilityProps","BaseChartComponent","BaseChartComponentState","WmBarChartProps","DEFAULT_CLASS","WmIcon","WmBarChartState","WmBarChart","constructor","props","_defineProperty","event","viewRef","current","state","dataset","dataIndex","y","seriesIndex","selectedItem","selectedChartItem","series","x","_dataObj","updateState","index","invokeEventCallback","proxy","labelFn","data","abbreviateNumber","datum","renderWidget","_this$state$data","_this$state$colors","_props$tooltip","length","chartData","map","i","name","yAxis","pt","showLegend","showlegend","legendPosition","includes","minDomain","getMinDomain","isHorizontal","horizontal","colors","color","showXAxis","showyaxis","showxaxis","showYAxis","xAxisTickLabelFormatter","undefined","getYAxisTickLabelFormatter","getXAxisTickLabelFormatter","yAxisTickLabelFormatter","height","rootHeight","wrapperStyle","styles","root","createElement","_extends","LINECHART","style","onLayout","onViewLayoutChange","bind","title","iconclass","iconurl","testID","flexDirection","alignItems","icon","subheading","subHeading","chartWidth","ref","width","screenWidth","theme","getChartTheme","stack","viewtype","stackNormalize","stacknormalize","cornerRadius","bar","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","barOutsideLabelFormatter","showvalues","value","String","minY","maxY","chartMaxY","minX","maxX","chartMaxX","grid","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","showXAxisTicks","showyaxisticks","showxaxisticks","showYAxisTicks","showXAxisSplitLines","hidegridyaxis","hidegridxaxis","showYAxisSplitLines","xAxisLabel","yLabel","xLabel","yAxisLabel","tooltip","tooltips","hasCustomTooltip","renderTooltip","getRenderTooltip","showHighlighter","showhighlighter","onSelect","intervalX","intervaly","intervalx","intervalY"],"sources":["bar-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\nimport { ColumnChart, CartesianChartSelectEvent, AreaChartAxisTooltipParams } from '@wavemaker/react-native-echarts';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker-ai/app-rn-runtime/components/chart/basechart.component\";\nimport WmBarChartProps from './bar-chart.props';\nimport { DEFAULT_CLASS, WmBarChartStyles } from './bar-chart.styles';\nimport WmIcon from \"@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component\";\nimport isEmpty from 'lodash-es/isEmpty';\n\nexport class WmBarChartState extends BaseChartComponentState<WmBarChartProps> {}\n\nexport default class WmBarChart extends BaseChartComponent<WmBarChartProps, WmBarChartState, WmBarChartStyles> {\n\n constructor(props: WmBarChartProps) {\n super(props, DEFAULT_CLASS, new WmBarChartProps(), new WmBarChartState());\n }\n\n labelFn(data: any): string | number | string[] | number[] | null {\n return this.abbreviateNumber(data.datum.y);\n }\n\n\n onSelect = (event: CartesianChartSelectEvent): void => {\n if (!this.viewRef.current) return;\n if (!this.state.props.dataset) return;\n const { dataIndex, y, seriesIndex } = event;\n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = [\n { series: seriesIndex, x: dataIndex, y, _dataObj: selectedItem },\n dataIndex,\n ];\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as WmBarChartState);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\n}\n\n renderWidget(props: WmBarChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n\n const chartData = this.state.data.map((series: any[], i: number) => ({\n name: this.state.yAxis[i],\n data: series.map((pt: { x: number; y: number }) => pt.y),\n }));\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n const minDomain = this.getMinDomain();\n\n // ColumnChart swaps category/value axes when horizontal=true. WaveMaker x-axis props\n // refer to categories (xaxisdatakey) and y-axis props refer to values (yaxisdatakey).\n const isHorizontal = !!props.horizontal;\n const series = (this.state.colors?.length ? this.state.colors : ['#000']).map((color: string) => ({\n color,\n }));\n const showXAxis = isHorizontal ? props.showyaxis : props.showxaxis;\n const showYAxis = isHorizontal ? props.showxaxis : props.showyaxis;\n const xAxisTickLabelFormatter = showXAxis === false\n ? undefined\n : (isHorizontal ? this.getYAxisTickLabelFormatter() : this.getXAxisTickLabelFormatter());\n const yAxisTickLabelFormatter = showYAxis === false\n ? undefined\n : (isHorizontal ? this.getXAxisTickLabelFormatter() : this.getYAxisTickLabelFormatter());\n\n const { height: rootHeight, ...wrapperStyle } = this.styles.root as any;\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={wrapperStyle}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n <View>\n {(props.title || props.iconclass || props.iconurl) ? (\n <View testID=\"title-icon-container\" style={{ flexDirection: 'row', alignItems: 'center' }}>\n {(props.iconclass || props.iconurl) ? (<WmIcon iconclass={props.iconclass} iconurl={props.iconurl} styles={this.styles.icon} />) : null}\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null}\n </View>\n ) : null}\n {props.subheading ? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n ) : null}\n </View>\n {this.state.chartWidth ? (\n <View ref={this.viewRef}>\n <ColumnChart\n data={chartData}\n width={this.state.chartWidth || this.screenWidth}\n height={this.styles.root.height as number}\n colors={this.state.colors}\n theme={this.getChartTheme(isHorizontal, series)}\n horizontal={props.horizontal}\n stack={props.viewtype === 'Stacked' ? 'total' : false}\n stackNormalize={props.stacknormalize}\n cornerRadius={[\n this.styles.bar.borderTopLeftRadius,\n this.styles.bar.borderTopRightRadius,\n this.styles.bar.borderBottomRightRadius,\n this.styles.bar.borderBottomLeftRadius,\n ]}\n barOutsideLabelFormatter={props.showvalues\n ? (value: number) => String(this.abbreviateNumber(value))\n : undefined}\n minY={minDomain.y}\n maxY={this.state.chartMaxY}\n minX={minDomain.x}\n maxX={this.state.chartMaxX}\n grid={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: this.isRTL ? props.offsetright : props.offsetleft,\n right: this.isRTL ? props.offsetleft : props.offsetright,\n }}\n showXAxis={showXAxis}\n showXAxisTicks={isHorizontal ? props.showyaxisticks : props.showxaxisticks}\n showYAxis={showYAxis}\n showYAxisTicks={isHorizontal ? props.showxaxisticks : props.showyaxisticks}\n showXAxisSplitLines={isHorizontal ? !props.hidegridyaxis : !props.hidegridxaxis}\n showYAxisSplitLines={isHorizontal ? !props.hidegridxaxis : !props.hidegridyaxis}\n xAxisLabel={isHorizontal ? (this.state.yLabel || '') : (this.state.xLabel || '')}\n yAxisLabel={isHorizontal ? (this.state.xLabel || '') : (this.state.yLabel || '')}\n xAxisTickLabelFormatter={xAxisTickLabelFormatter}\n yAxisTickLabelFormatter={yAxisTickLabelFormatter}\n showLegend={showLegend}\n legendPosition={legendPosition}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n renderTooltip={this.getRenderTooltip()}\n showHighlighter={props.showhighlighter}\n onSelect={this.onSelect}\n intervalX={isHorizontal ? props.intervaly : props.intervalx}\n intervalY={isHorizontal ? props.intervalx : props.intervaly}\n />\n </View>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,WAAW,QAA+D,iCAAiC;AACpH,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAChH,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,mEAAmE;AAC1E,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AACpE,OAAOC,MAAM,MAAM,mEAAmE;AAGtF,OAAO,MAAMC,eAAe,SAASJ,uBAAuB,CAAkB;AAE9E,eAAe,MAAMK,UAAU,SAASN,kBAAkB,CAAqD;EAE7GO,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIG,eAAe,CAAC,CAAC,CAAC;IAACI,eAAA,mBAQhEC,KAAgC,IAAW;MACvD,IAAI,CAAC,IAAI,CAACC,OAAO,CAACC,OAAO,EAAE;MAC3B,IAAI,CAAC,IAAI,CAACC,KAAK,CAACL,KAAK,CAACM,OAAO,EAAE;MAC/B,MAAM;QAAEC,SAAS;QAAEC,CAAC;QAAEC;MAAY,CAAC,GAAGP,KAAK;MAC3C,MAAMQ,YAAY,GAAG,IAAI,CAACV,KAAK,CAACM,OAAO,CAACC,SAAS,CAAC;MAClD,MAAMI,iBAAiB,GAAG,CACxB;QAAEC,MAAM,EAAEH,WAAW;QAAEI,CAAC,EAAEN,SAAS;QAAEC,CAAC;QAAEM,QAAQ,EAAEJ;MAAa,C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onAnimationProps {
|
|
|
8
8
|
_defineProperty(this, "xaxisdatakey", '');
|
|
9
9
|
_defineProperty(this, "yaxisdatakey", '');
|
|
10
10
|
_defineProperty(this, "iconclass", '');
|
|
11
|
+
_defineProperty(this, "iconurl", '');
|
|
11
12
|
_defineProperty(this, "dataset", void 0);
|
|
12
13
|
_defineProperty(this, "type", '');
|
|
13
14
|
_defineProperty(this, "title", '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SkeletonAnimationProps","BaseChartComponentProps","constructor","args","_defineProperty","undefined"],"sources":["basechart.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { SkeletonAnimationProps } from '@wavemaker-ai/app-rn-runtime/runtime/base-fragment.component';\nimport { CartesianGrid } from '@wavemaker/react-native-echarts/props/cartesian';\nimport { ChartTooltipOption } from '@wavemaker/react-native-echarts/tooltip';\nimport { AccessibilityRole } from 'react-native';\n\nexport default class BaseChartComponentProps extends SkeletonAnimationProps {\n xaxisdatakey: string = '';\n yaxisdatakey: string = '';\n iconclass = '';\n dataset: any;\n type: string = '';\n title: string = '';\n subheading: string = '';\n theme: string = '';\n xaxislabel: string = '';\n xunits: string = '';\n staggerlabels: boolean = false;\n yaxislabel: string = '';\n yunits: string = '';\n yaxislabeldistance?: number = undefined;\n xaxislabeldistance?: number = undefined;\n offsetxaxis?: number = undefined;\n offsetyaxis?: number = undefined;\n customcolors: string | Array<string> = '';\n labelcolors: string | Array<string> = '';\n legendheight: number = 0;\n labellegendheight: number = 0;\n labeltype: 'percent' | 'value' | 'key-value' | 'key' = 'percent';\n bubblesize: string= '';\n shape: string = '';\n loadingicon='fa fa-circle-o-notch fa-pulse';\n loadingdatamsg = 'Loading...';\n nodatamessage = 'No data found';\n offsetbottom: number = 50;\n offsettop: number = 70;\n offsetleft: number = 65;\n offsetright: number = 25;\n showlegend: string = 'top';\n showlabels: 'inside' | 'outside' | 'hide' = 'outside';\n tooltips: boolean = true;\n interpolation: string = 'linear';\n highlightpoints: boolean = false;\n showvalues: boolean = false;\n showyaxis: boolean = true;\n showxaxis: boolean = true;\n ydomain: string = 'Min';\n xdomain: string = 'Min';\n labelangle: number = 0;\n xtickexpr?: (item: any, index: number, length: number) => any;\n ytickexpr?: (item: any, index: number, length: number) => any;\n hidegridxaxis: boolean = false;\n hidegridyaxis: boolean = false;\n autoadjustlabels: boolean = false;\n accessible?: boolean = true;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n ynumberformat?: string = '';\n showxaxislabels: boolean = true;\n showyaxislabels: boolean = true;\n chartheight?: number;\n showxaxisticks?: boolean;\n showyaxisticks?: boolean;\n boundarygap?: boolean;\n grid?: CartesianGrid;\n tooltip?: ChartTooltipOption;\n showhighlighter: boolean = true;\n stacknormalize?: boolean = false;\n ticksymbol?: 'none' | 'circle' | 'rect' | 'roundRect' | 'triangle' | 'diamond' | 'pin' | 'arrow' | string;\n stepposition?: 'start' | 'middle' | 'end' | false;\n symbolsize?: number = 5;\n intervalx?: number = undefined;\n intervaly?: number = undefined\n}\n"],"mappings":";;;AACA,SAASA,sBAAsB,QAAQ,8DAA8D;AAKrG,eAAe,MAAMC,uBAAuB,SAASD,sBAAsB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBACnD,EAAE;IAAAA,eAAA,uBACF,EAAE;IAAAA,eAAA,oBACb,EAAE;IAAAA,eAAA;IAAAA,eAAA,
|
|
1
|
+
{"version":3,"names":["SkeletonAnimationProps","BaseChartComponentProps","constructor","args","_defineProperty","undefined"],"sources":["basechart.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { SkeletonAnimationProps } from '@wavemaker-ai/app-rn-runtime/runtime/base-fragment.component';\nimport { CartesianGrid } from '@wavemaker/react-native-echarts/props/cartesian';\nimport { ChartTooltipOption } from '@wavemaker/react-native-echarts/tooltip';\nimport { AccessibilityRole } from 'react-native';\n\nexport default class BaseChartComponentProps extends SkeletonAnimationProps {\n xaxisdatakey: string = '';\n yaxisdatakey: string = '';\n iconclass = '';\n iconurl = '';\n dataset: any;\n type: string = '';\n title: string = '';\n subheading: string = '';\n theme: string = '';\n xaxislabel: string = '';\n xunits: string = '';\n staggerlabels: boolean = false;\n yaxislabel: string = '';\n yunits: string = '';\n yaxislabeldistance?: number = undefined;\n xaxislabeldistance?: number = undefined;\n offsetxaxis?: number = undefined;\n offsetyaxis?: number = undefined;\n customcolors: string | Array<string> = '';\n labelcolors: string | Array<string> = '';\n legendheight: number = 0;\n labellegendheight: number = 0;\n labeltype: 'percent' | 'value' | 'key-value' | 'key' = 'percent';\n bubblesize: string= '';\n shape: string = '';\n loadingicon='fa fa-circle-o-notch fa-pulse';\n loadingdatamsg = 'Loading...';\n nodatamessage = 'No data found';\n offsetbottom: number = 50;\n offsettop: number = 70;\n offsetleft: number = 65;\n offsetright: number = 25;\n showlegend: string = 'top';\n showlabels: 'inside' | 'outside' | 'hide' = 'outside';\n tooltips: boolean = true;\n interpolation: string = 'linear';\n highlightpoints: boolean = false;\n showvalues: boolean = false;\n showyaxis: boolean = true;\n showxaxis: boolean = true;\n ydomain: string = 'Min';\n xdomain: string = 'Min';\n labelangle: number = 0;\n xtickexpr?: (item: any, index: number, length: number) => any;\n ytickexpr?: (item: any, index: number, length: number) => any;\n hidegridxaxis: boolean = false;\n hidegridyaxis: boolean = false;\n autoadjustlabels: boolean = false;\n accessible?: boolean = true;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n ynumberformat?: string = '';\n showxaxislabels: boolean = true;\n showyaxislabels: boolean = true;\n chartheight?: number;\n showxaxisticks?: boolean;\n showyaxisticks?: boolean;\n boundarygap?: boolean;\n grid?: CartesianGrid;\n tooltip?: ChartTooltipOption;\n showhighlighter: boolean = true;\n stacknormalize?: boolean = false;\n ticksymbol?: 'none' | 'circle' | 'rect' | 'roundRect' | 'triangle' | 'diamond' | 'pin' | 'arrow' | string;\n stepposition?: 'start' | 'middle' | 'end' | false;\n symbolsize?: number = 5;\n intervalx?: number = undefined;\n intervaly?: number = undefined\n}\n"],"mappings":";;;AACA,SAASA,sBAAsB,QAAQ,8DAA8D;AAKrG,eAAe,MAAMC,uBAAuB,SAASD,sBAAsB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBACnD,EAAE;IAAAA,eAAA,uBACF,EAAE;IAAAA,eAAA,oBACb,EAAE;IAAAA,eAAA,kBACJ,EAAE;IAAAA,eAAA;IAAAA,eAAA,eAEG,EAAE;IAAAA,eAAA,gBACD,EAAE;IAAAA,eAAA,qBACG,EAAE;IAAAA,eAAA,gBACP,EAAE;IAAAA,eAAA,qBACG,EAAE;IAAAA,eAAA,iBACN,EAAE;IAAAA,eAAA,wBACM,KAAK;IAAAA,eAAA,qBACT,EAAE;IAAAA,eAAA,iBACN,EAAE;IAAAA,eAAA,6BACWC,SAAS;IAAAD,eAAA,6BACTC,SAAS;IAAAD,eAAA,sBAChBC,SAAS;IAAAD,eAAA,sBACTC,SAAS;IAAAD,eAAA,uBACO,EAAE;IAAAA,eAAA,sBACH,EAAE;IAAAA,eAAA,uBACjB,CAAC;IAAAA,eAAA,4BACI,CAAC;IAAAA,eAAA,oBAC0B,SAAS;IAAAA,eAAA,qBAC5C,EAAE;IAAAA,eAAA,gBACN,EAAE;IAAAA,eAAA,sBACN,+BAA+B;IAAAA,eAAA,yBAC1B,YAAY;IAAAA,eAAA,wBACb,eAAe;IAAAA,eAAA,uBACR,EAAE;IAAAA,eAAA,oBACL,EAAE;IAAAA,eAAA,qBACD,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA,qBACH,KAAK;IAAAA,eAAA,qBACkB,SAAS;IAAAA,eAAA,mBACjC,IAAI;IAAAA,eAAA,wBACA,QAAQ;IAAAA,eAAA,0BACL,KAAK;IAAAA,eAAA,qBACV,KAAK;IAAAA,eAAA,oBACN,IAAI;IAAAA,eAAA,oBACJ,IAAI;IAAAA,eAAA,kBACP,KAAK;IAAAA,eAAA,kBACL,KAAK;IAAAA,eAAA,qBACF,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,wBAGG,KAAK;IAAAA,eAAA,wBACL,KAAK;IAAAA,eAAA,2BACF,KAAK;IAAAA,eAAA,qBACV,IAAI;IAAAA,eAAA,6BACGC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;IAAAA,eAAA;IAAAA,eAAA,wBAGA,EAAE;IAAAA,eAAA,0BACA,IAAI;IAAAA,eAAA,0BACJ,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,0BAOJ,IAAI;IAAAA,eAAA,yBACJ,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAGV,CAAC;IAAAA,eAAA,oBACFC,SAAS;IAAAD,eAAA,oBACTC,SAAS;EAAA;AAChC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Color","BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","icon","fontSize","line","color","chartLineColor","title","chartTitleColor","lineHeight","paddingLeft","subHeading","chartSubTitleColor","legendText","legenedDot","axis","stroke","chartAxisColor","fade","rgb","toString","xAxis","yAxis","axisLabel","xAxisLabel","yAxisLabel","grid","strokeDasharray","xGrid","yGrid","ticks","xTicks","yTicks","tickLabels","xTickLabels","yTickLabels","barChart","tooltipXText","tooltipYText","bar","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","tooltipContainer","position","
|
|
1
|
+
{"version":3,"names":["Color","BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","icon","fontSize","line","color","chartLineColor","title","chartTitleColor","lineHeight","paddingLeft","subHeading","chartSubTitleColor","legendText","legenedDot","axis","stroke","chartAxisColor","fade","rgb","toString","xAxis","yAxis","axisLabel","xAxisLabel","yAxisLabel","grid","strokeDasharray","xGrid","yGrid","ticks","xTicks","yTicks","tickLabels","xTickLabels","yTickLabels","barChart","tooltipXText","tooltipYText","bar","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","tooltipContainer","position","flex","minWidth","minHeight","opacity","borderRadius","justifyContent","alignItems","elevation","zIndex","tooltipPointer","width","height","backgroundColor","transparent","borderStyle","borderLeftWidth","borderRightWidth","borderBottomWidth","borderLeftColor","borderRightColor","borderBottomColor","tooltipBgColor","overflow","centerLabel"],"sources":["basechart.styles.ts"],"sourcesContent":["import { TextStyle, ViewStyle } from 'react-native';\nimport Color from \"color\";\nimport BASE_THEME from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '../basic/skeleton/skeleton.styles';\n\n\nexport type ChartStyleObject = {\n stroke?: string;\n strokeWidth?: number;\n strokeDasharray?: string;\n fill?: string;\n fontSize?: number;\n [key: string]: any;\n};\n\nexport type BaseChartComponentStyles = BaseStyles & {\n title: TextStyle,\n icon: WmIconStyles,\n subHeading: TextStyle,\n axis: ChartStyleObject,\n xAxis: ChartStyleObject,\n yAxis: ChartStyleObject,\n axisLabel: ChartStyleObject,\n xAxisLabel: ChartStyleObject,\n yAxisLabel: ChartStyleObject,\n ticks: ChartStyleObject,\n xTicks: ChartStyleObject,\n yTicks: ChartStyleObject,\n tickLabels: ChartStyleObject,\n xTickLabels: ChartStyleObject,\n yTickLabels: ChartStyleObject,\n grid: ChartStyleObject,\n xGrid: ChartStyleObject,\n yGrid: ChartStyleObject,\n legendText: TextStyle,\n legenedDot: ViewStyle,\n tooltipContainer: any,\n tooltipPointer: any\n tooltipXText: any,\n tooltipYText: any,\n bar: any;\n centerLabel: ChartStyleObject,\n skeleton?: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-chart';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: BaseChartComponentStyles = defineStyles({\n root: {},\n text: {},\n icon: {\n icon: {\n fontSize: 20\n }\n } as WmIconStyles,\n line: {\n color: themeVariables.chartLineColor\n },\n title: {\n color: themeVariables.chartTitleColor,\n fontSize: 20,\n lineHeight: 24,\n paddingLeft: 10,\n },\n subHeading: {\n fontSize: 12,\n lineHeight: 16,\n color: themeVariables.chartSubTitleColor\n },\n legendText: {},\n legenedDot: {},\n axis: {\n stroke: Color(themeVariables.chartAxisColor).fade(0.3).rgb().toString()\n } as ChartStyleObject,\n xAxis: {},\n yAxis: {},\n axisLabel: {},\n xAxisLabel: {},\n yAxisLabel: {},\n grid: {\n stroke: Color(themeVariables.chartAxisColor).fade(0.8).rgb().toString(),\n strokeDasharray: '16 4'\n } as ChartStyleObject,\n xGrid: {},\n yGrid: {},\n ticks: {\n stroke: Color(themeVariables.chartAxisColor).fade(0.8).rgb().toString(),\n } as ChartStyleObject,\n xTicks: {},\n yTicks: {},\n tickLabels: {\n stroke: Color(themeVariables.chartAxisColor).fade(0.8).rgb().toString(),\n } as ChartStyleObject,\n xTickLabels: {},\n yTickLabels: {},\n barChart: {},\n tooltipXText:{},\n tooltipYText:{},\n bar:{\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0\n },\n tooltipContainer: {\n position: 'absolute',\n flex: 1,\n minWidth: 100,\n minHeight: 60,\n opacity: 0.9,\n borderRadius: 12,\n justifyContent: 'center',\n alignItems: 'center',\n elevation: 2,\n zIndex: 99\n } as any,\n tooltipPointer: {\n position: 'absolute',\n width: 0,\n height: 0,\n backgroundColor: themeVariables.transparent,\n borderStyle: 'solid',\n borderLeftWidth: 8,\n borderRightWidth: 8,\n borderBottomWidth: 12,\n borderLeftColor: themeVariables.transparent,\n borderRightColor: themeVariables.transparent,\n borderBottomColor: themeVariables.tooltipBgColor,\n overflow: 'hidden',\n } as any,\n centerLabel: {\n color: themeVariables.chartTitleColor,\n fontSize: 20,\n },\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AACA,OAAOA,KAAK,MAAO,OAAO;AAC1B,OAAOC,UAAU,MAAM,2CAA2C;AAClE,SAAqBC,YAAY,QAAQ,kDAAkD;AA4C3F,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAAuC,GAAGL,YAAY,CAAC;IAC3DM,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE;MACJA,IAAI,EAAE;QACJC,QAAQ,EAAE;MACZ;IACF,CAAiB;IACjBC,IAAI,EAAE;MACJC,KAAK,EAAER,cAAc,CAACS;IACxB,CAAC;IACDC,KAAK,EAAE;MACLF,KAAK,EAAER,cAAc,CAACW,eAAe;MACrCL,QAAQ,EAAE,EAAE;MACZM,UAAU,EAAE,EAAE;MACdC,WAAW,EAAE;IACf,CAAC;IACDC,UAAU,EAAE;MACVR,QAAQ,EAAE,EAAE;MACZM,UAAU,EAAE,EAAE;MACdJ,KAAK,EAAER,cAAc,CAACe;IACxB,CAAC;IACDC,UAAU,EAAE,CAAC,CAAC;IACdC,UAAU,EAAE,CAAC,CAAC;IACdC,IAAI,EAAE;MACJC,MAAM,EAAExB,KAAK,CAACK,cAAc,CAACoB,cAAc,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC;IACxE,CAAqB;IACrBC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AE;MAChBC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBC,SAAS,EAAE,CAAC;MACZC,MAAM,EAAE;IACV,CAAQ;IACRC,cAAc,EAAE;MACdV,QAAQ,EAAE,UAAU;MACpBW,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,eAAe,EAAE7D,cAAc,CAAC8D,WAAW;MAC3CC,WAAW,EAAE,OAAO;MACpBC,eAAe,EAAE,CAAC;MAClBC,gBAAgB,EAAE,CAAC;MACnBC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAEnE,cAAc,CAAC8D,WAAW;MAC3CM,gBAAgB,EAAEpE,cAAc,CAAC8D,WAAW;MAC5CO,iBAAiB,EAAErE,cAAc,CAACsE,cAAc;MAChDC,QAAQ,EAAE;IACZ,CAAQ;IACRC,WAAW,EAAE;MACXhE,KAAK,EAAER,cAAc,CAACW,eAAe;MACrCL,QAAQ,EAAE;IACZ;EACF,CAAC,CAAC;EAEFL,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -10,6 +10,19 @@ import { BaseChartComponent, BaseChartComponentState } from "@wavemaker-ai/app-r
|
|
|
10
10
|
import WmBubbleChartProps from './bubble-chart.props';
|
|
11
11
|
import { DEFAULT_CLASS } from './bubble-chart.styles';
|
|
12
12
|
import WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';
|
|
13
|
+
const SHAPE_TO_SYMBOL = {
|
|
14
|
+
'circle': 'circle',
|
|
15
|
+
'rect': 'rect',
|
|
16
|
+
'square': 'rect',
|
|
17
|
+
'roundRect': 'roundRect',
|
|
18
|
+
'triangle': 'triangle',
|
|
19
|
+
'triangle-up': 'triangle',
|
|
20
|
+
'triangle-down': 'path://M0,500L500,-500L-500,-500Z',
|
|
21
|
+
'diamond': 'diamond',
|
|
22
|
+
'pin': 'pin',
|
|
23
|
+
'arrow': 'arrow',
|
|
24
|
+
'cross': 'path://M-70,-500L70,-500L70,-220L350,-220L350,-80L70,-80L70,500L-70,500L-70,-80L-350,-80L-350,-220L-70,-220Z M500,0L500,0Z M-500,0L-500,0Z'
|
|
25
|
+
};
|
|
13
26
|
export class WmBubbleChartState extends BaseChartComponentState {}
|
|
14
27
|
export default class WmBubbleChart extends BaseChartComponent {
|
|
15
28
|
constructor(props) {
|
|
@@ -57,17 +70,23 @@ export default class WmBubbleChart extends BaseChartComponent {
|
|
|
57
70
|
const series = ((_this$state$colors = this.state.colors) !== null && _this$state$colors !== void 0 && _this$state$colors.length ? this.state.colors : ['#000']).map(color => ({
|
|
58
71
|
color
|
|
59
72
|
}));
|
|
73
|
+
const {
|
|
74
|
+
height: rootHeight,
|
|
75
|
+
...wrapperStyle
|
|
76
|
+
} = this.styles.root;
|
|
77
|
+
const symbol = SHAPE_TO_SYMBOL[props.shape] || 'circle';
|
|
60
78
|
return /*#__PURE__*/React.createElement(View, _extends({}, getAccessibilityProps(AccessibilityWidgetType.LINECHART, props), {
|
|
61
|
-
style:
|
|
79
|
+
style: wrapperStyle,
|
|
62
80
|
onLayout: this.onViewLayoutChange.bind(this)
|
|
63
|
-
}), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass ? /*#__PURE__*/React.createElement(View, {
|
|
81
|
+
}), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(View, {
|
|
64
82
|
testID: "title-icon-container",
|
|
65
83
|
style: {
|
|
66
84
|
flexDirection: 'row',
|
|
67
85
|
alignItems: 'center'
|
|
68
86
|
}
|
|
69
|
-
}, props.iconclass ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
87
|
+
}, props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
70
88
|
iconclass: props.iconclass,
|
|
89
|
+
iconurl: props.iconurl,
|
|
71
90
|
styles: this.styles.icon
|
|
72
91
|
}) : null, props.title ? /*#__PURE__*/React.createElement(Text, {
|
|
73
92
|
style: this.styles.title
|
|
@@ -100,10 +119,10 @@ export default class WmBubbleChart extends BaseChartComponent {
|
|
|
100
119
|
showYAxisSplitLines: !props.hidegridyaxis,
|
|
101
120
|
xAxisLabel: this.state.xLabel || '',
|
|
102
121
|
yAxisLabel: this.state.yLabel || '',
|
|
103
|
-
xAxisTickLabelFormatter: this.getXAxisTickLabelFormatter(),
|
|
104
|
-
yAxisTickLabelFormatter: this.getYAxisTickLabelFormatter(),
|
|
122
|
+
xAxisTickLabelFormatter: props.showxaxis !== false ? this.getXAxisTickLabelFormatter() : undefined,
|
|
123
|
+
yAxisTickLabelFormatter: props.showyaxis !== false ? this.getYAxisTickLabelFormatter() : undefined,
|
|
105
124
|
showLegend: showLegend,
|
|
106
|
-
symbol:
|
|
125
|
+
symbol: symbol,
|
|
107
126
|
legendPosition: legendPosition,
|
|
108
127
|
tooltip: props.tooltips ? this.hasCustomTooltip ? 'none' : (_props$tooltip = props.tooltip) !== null && _props$tooltip !== void 0 ? _props$tooltip : 'card' : 'none',
|
|
109
128
|
renderTooltip: this.getRenderTooltip(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","BubbleChart","AccessibilityWidgetType","getAccessibilityProps","BaseChartComponent","BaseChartComponentState","WmBubbleChartProps","DEFAULT_CLASS","WmIcon","WmBubbleChartState","WmBubbleChart","constructor","props","_defineProperty","event","state","dataset","dataIndex","y","seriesIndex","selectedItem","selectedChartItem","series","x","_dataObj","updateState","index","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$state$colors","_props$intervalx","_props$tooltip","data","length","chartData","map","i","name","yAxis","pt","_pt$size","size","showLegend","showlegend","legendPosition","includes","minDomain","getMinDomain","xaxisticks","getXAxisTickLabelFormatter","colors","color","createElement","_extends","LINECHART","style","styles","root","onLayout","onViewLayoutChange","bind","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","chartWidth","ref","viewRef","width","screenWidth","height","theme","getChartTheme","sizeRange","sizerange","minY","minX","intervalX","intervalx","intervalY","intervaly","grid","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","showXAxis","showxaxis","showXAxisTicks","showxaxisticks","showYAxis","showyaxis","showYAxisTicks","showyaxisticks","showXAxisSplitLines","hidegridxaxis","showYAxisSplitLines","hidegridyaxis","xAxisLabel","xLabel","yAxisLabel","yLabel","xAxisTickLabelFormatter","yAxisTickLabelFormatter","getYAxisTickLabelFormatter","symbol","ticksymbol","tooltip","tooltips","hasCustomTooltip","renderTooltip","getRenderTooltip","showHighlighter","showhighlighter","onSelect"],"sources":["bubble-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { BubbleChart, CartesianChartSelectEvent } from '@wavemaker/react-native-echarts';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker-ai/app-rn-runtime/components/chart/basechart.component\";\nimport WmBubbleChartProps from './bubble-chart.props';\nimport { DEFAULT_CLASS, WmBubbleChartStyles } from './bubble-chart.styles';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport isEmpty from 'lodash-es/isEmpty';\n\nexport class WmBubbleChartState extends BaseChartComponentState<WmBubbleChartProps> {}\n\nexport default class WmBubbleChart extends BaseChartComponent<WmBubbleChartProps, WmBubbleChartState, WmBubbleChartStyles> {\n\n constructor(props: WmBubbleChartProps) {\n super(props, DEFAULT_CLASS, new WmBubbleChartProps(), new WmBubbleChartState());\n }\n\n onSelect = (event: CartesianChartSelectEvent): void => {\n if (!this.state.props.dataset) return;\n const { dataIndex, y, seriesIndex } = event;\n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = [\n { series: seriesIndex, x: dataIndex, y, _dataObj: selectedItem },\n dataIndex,\n ];\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as WmBubbleChartState);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\n}\n renderWidget(props: WmBubbleChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n \n const chartData = this.state.data.map((series: any[], i: number) => ({\n name: this.state.yAxis[i],\n data: series.map((pt: { x: number; y: number; size?: number }) =>\n [pt.x, pt.y, pt.size ?? 5] as [number, number, number]\n ),\n }));\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n const minDomain = this.getMinDomain();\n const xaxisticks = this.getXAxisTickLabelFormatter();\n const series = (this.state.colors?.length ? this.state.colors : ['#000']).map((color: string) => ({\n color,\n }));\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n <View>\n {(props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{ flexDirection: 'row', alignItems: 'center' }}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon} />) : null}\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null}\n </View>\n ) : null}\n {props.subheading ? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n ) : null}\n </View>\n {this.state.chartWidth ? (\n <View ref={this.viewRef}>\n <BubbleChart\n data={chartData}\n width={this.state.chartWidth || this.screenWidth}\n height={this.styles.root.height as number}\n colors={this.state.colors}\n theme={this.getChartTheme(false, series)}\n sizeRange={props.sizerange}\n minY={minDomain.y}\n minX={minDomain.x}\n intervalX={props.intervalx ?? 1} \n intervalY={props.intervaly}\n grid={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: this.isRTL ? props.offsetright : props.offsetleft,\n right: this.isRTL ? props.offsetleft : props.offsetright,\n }}\n showXAxis={props.showxaxis}\n showXAxisTicks={props.showxaxisticks}\n showYAxis={props.showyaxis}\n showYAxisTicks={props.showyaxisticks}\n showXAxisSplitLines={!props.hidegridxaxis}\n showYAxisSplitLines={!props.hidegridyaxis}\n xAxisLabel={this.state.xLabel || ''}\n yAxisLabel={this.state.yLabel || ''}\n xAxisTickLabelFormatter={this.getXAxisTickLabelFormatter()}\n yAxisTickLabelFormatter={this.getYAxisTickLabelFormatter()}\n showLegend={showLegend}\n symbol={props.ticksymbol}\n legendPosition={legendPosition}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n renderTooltip={this.getRenderTooltip()}\n showHighlighter={props.showhighlighter}\n onSelect={this.onSelect}\n />\n </View>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,WAAW,QAAmC,iCAAiC;AACxF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAChH,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,mEAAmE;AAC1E,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAC1E,OAAOC,MAAM,MAAM,mEAAmE;AAGtF,OAAO,MAAMC,kBAAkB,SAASJ,uBAAuB,CAAqB;AAEpF,eAAe,MAAMK,aAAa,SAASN,kBAAkB,CAA8D;EAEzHO,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,kBAAkB,CAAC,CAAC,EAAE,IAAIG,kBAAkB,CAAC,CAAC,CAAC;IAACI,eAAA,mBAGtEC,KAAgC,IAAW;MACvD,IAAI,CAAC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,OAAO,EAAE;MAC/B,MAAM;QAAEC,SAAS;QAAEC,CAAC;QAAEC;MAAY,CAAC,GAAGL,KAAK;MAC3C,MAAMM,YAAY,GA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,IAAI,CAACC,KAAK,GAAGjF,KAAK,CAACkF,WAAW,GAAGlF,KAAK,CAACmF,UAAU;QACvDC,KAAK,EAAE,IAAI,CAACH,KAAK,GAAGjF,KAAK,CAACmF,UAAU,GAAGnF,KAAK,CAACkF;MAC/C,CAAE;MACFG,SAAS,EAAErF,KAAK,CAACsF,SAAU;MAC3BC,cAAc,EAAEvF,KAAK,CAACwF,cAAe;MACrCC,SAAS,EAAEzF,KAAK,CAAC0F,SAAU;MAC3BC,cAAc,EAAE3F,KAAK,CAAC4F,cAAe;MACrCC,mBAAmB,EAAE,CAAC7F,KAAK,CAAC8F,aAAc;MAC1CC,mBAAmB,EAAE,CAAC/F,KAAK,CAACgG,aAAc;MAC1CC,UAAU,EAAE,IAAI,CAAC9F,KAAK,CAAC+F,MAAM,IAAI,EAAG;MACpCC,UAAU,EAAE,IAAI,CAAChG,KAAK,CAACiG,MAAM,IAAI,EAAG;MACpCC,uBAAuB,EAAE,IAAI,CAAC9D,0BAA0B,CAAC,CAAE;MAC3D+D,uBAAuB,EAAE,IAAI,CAACC,0BAA0B,CAAC,CAAE;MAC3DvE,UAAU,EAAEA,UAAW;MACvBwE,MAAM,EAAExG,KAAK,CAACyG,UAAW;MACzBvE,cAAc,EAAEA,cAAe;MAC/BwE,OAAO,EAAE1G,KAAK,CAAC2G,QAAQ,GAAI,IAAI,CAACC,gBAAgB,GAAG,MAAM,IAAAvF,cAAA,GAAIrB,KAAK,CAAC0G,OAAO,cAAArF,cAAA,cAAAA,cAAA,GAAI,MAAO,GAAI,MAAO;MAChGwF,aAAa,EAAE,IAAI,CAACC,gBAAgB,CAAC,CAAE;MACvCC,eAAe,EAAE/G,KAAK,CAACgH,eAAgB;MACvCC,QAAQ,EAAE,IAAI,CAACA;IAAS,CACzB,CACG,CAAC,GACL,IACA,CAAC;EAEX;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Text","View","BubbleChart","AccessibilityWidgetType","getAccessibilityProps","BaseChartComponent","BaseChartComponentState","WmBubbleChartProps","DEFAULT_CLASS","WmIcon","SHAPE_TO_SYMBOL","WmBubbleChartState","WmBubbleChart","constructor","props","_defineProperty","event","state","dataset","dataIndex","y","seriesIndex","selectedItem","selectedChartItem","series","x","_dataObj","updateState","index","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$state$colors","_props$intervalx","_props$tooltip","data","length","chartData","map","i","name","yAxis","pt","_pt$size","size","showLegend","showlegend","legendPosition","includes","minDomain","getMinDomain","xaxisticks","getXAxisTickLabelFormatter","colors","color","height","rootHeight","wrapperStyle","styles","root","symbol","shape","createElement","_extends","LINECHART","style","onLayout","onViewLayoutChange","bind","title","iconclass","iconurl","testID","flexDirection","alignItems","icon","subheading","subHeading","chartWidth","ref","viewRef","width","screenWidth","theme","getChartTheme","sizeRange","sizerange","minY","minX","intervalX","intervalx","intervalY","intervaly","grid","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","showXAxis","showxaxis","showXAxisTicks","showxaxisticks","showYAxis","showyaxis","showYAxisTicks","showyaxisticks","showXAxisSplitLines","hidegridxaxis","showYAxisSplitLines","hidegridyaxis","xAxisLabel","xLabel","yAxisLabel","yLabel","xAxisTickLabelFormatter","undefined","yAxisTickLabelFormatter","getYAxisTickLabelFormatter","tooltip","tooltips","hasCustomTooltip","renderTooltip","getRenderTooltip","showHighlighter","showhighlighter","onSelect"],"sources":["bubble-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { BubbleChart, CartesianChartSelectEvent } from '@wavemaker/react-native-echarts';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker-ai/app-rn-runtime/components/chart/basechart.component\";\nimport WmBubbleChartProps from './bubble-chart.props';\nimport { DEFAULT_CLASS, WmBubbleChartStyles } from './bubble-chart.styles';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport isEmpty from 'lodash-es/isEmpty';\n\n\nconst SHAPE_TO_SYMBOL: {[key: string]: string} = {\n 'circle': 'circle',\n 'rect': 'rect',\n 'square': 'rect',\n 'roundRect': 'roundRect',\n 'triangle': 'triangle',\n 'triangle-up': 'triangle',\n 'triangle-down': 'path://M0,500L500,-500L-500,-500Z',\n 'diamond': 'diamond',\n 'pin': 'pin',\n 'arrow': 'arrow',\n 'cross': 'path://M-70,-500L70,-500L70,-220L350,-220L350,-80L70,-80L70,500L-70,500L-70,-80L-350,-80L-350,-220L-70,-220Z M500,0L500,0Z M-500,0L-500,0Z',\n};\n\nexport class WmBubbleChartState extends BaseChartComponentState<WmBubbleChartProps> {}\n\nexport default class WmBubbleChart extends BaseChartComponent<WmBubbleChartProps, WmBubbleChartState, WmBubbleChartStyles> {\n\n constructor(props: WmBubbleChartProps) {\n super(props, DEFAULT_CLASS, new WmBubbleChartProps(), new WmBubbleChartState());\n }\n\n onSelect = (event: CartesianChartSelectEvent): void => {\n if (!this.state.props.dataset) return;\n const { dataIndex, y, seriesIndex } = event;\n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = [\n { series: seriesIndex, x: dataIndex, y, _dataObj: selectedItem },\n dataIndex,\n ];\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as WmBubbleChartState);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\n}\n renderWidget(props: WmBubbleChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n \n const chartData = this.state.data.map((series: any[], i: number) => ({\n name: this.state.yAxis[i],\n data: series.map((pt: { x: number; y: number; size?: number }) =>\n [pt.x, pt.y, pt.size ?? 5] as [number, number, number]\n ),\n }));\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n const minDomain = this.getMinDomain();\n const xaxisticks = this.getXAxisTickLabelFormatter();\n const series = (this.state.colors?.length ? this.state.colors : ['#000']).map((color: string) => ({\n color,\n }));\n const { height: rootHeight, ...wrapperStyle } = this.styles.root as any;\n const symbol = SHAPE_TO_SYMBOL[props.shape] || 'circle';\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={wrapperStyle}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n <View>\n {(props.title || props.iconclass || props.iconurl) ? (\n <View testID=\"title-icon-container\" style={{ flexDirection: 'row', alignItems: 'center' }}>\n {(props.iconclass || props.iconurl) ? (<WmIcon iconclass={props.iconclass} iconurl={props.iconurl} styles={this.styles.icon} />) : null}\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null}\n </View>\n ) : null}\n {props.subheading ? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n ) : null}\n </View>\n {this.state.chartWidth ? (\n <View ref={this.viewRef}>\n <BubbleChart\n data={chartData}\n width={this.state.chartWidth || this.screenWidth}\n height={this.styles.root.height as number}\n colors={this.state.colors}\n theme={this.getChartTheme(false, series)}\n sizeRange={props.sizerange}\n minY={minDomain.y}\n minX={minDomain.x}\n intervalX={props.intervalx ?? 1} \n intervalY={props.intervaly}\n grid={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: this.isRTL ? props.offsetright : props.offsetleft,\n right: this.isRTL ? props.offsetleft : props.offsetright,\n }}\n showXAxis={props.showxaxis}\n showXAxisTicks={props.showxaxisticks}\n showYAxis={props.showyaxis}\n showYAxisTicks={props.showyaxisticks}\n showXAxisSplitLines={!props.hidegridxaxis}\n showYAxisSplitLines={!props.hidegridyaxis}\n xAxisLabel={this.state.xLabel || ''}\n yAxisLabel={this.state.yLabel || ''}\n xAxisTickLabelFormatter={props.showxaxis !== false ? this.getXAxisTickLabelFormatter() : undefined}\n yAxisTickLabelFormatter={props.showyaxis !== false ? this.getYAxisTickLabelFormatter() : undefined}\n showLegend={showLegend}\n symbol={symbol}\n legendPosition={legendPosition}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n renderTooltip={this.getRenderTooltip()}\n showHighlighter={props.showhighlighter}\n onSelect={this.onSelect}\n />\n </View>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,WAAW,QAAmC,iCAAiC;AACxF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAChH,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,mEAAmE;AAC1E,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAC1E,OAAOC,MAAM,MAAM,mEAAmE;AAItF,MAAMC,eAAwC,GAAG;EAC/C,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,MAAM;EACd,QAAQ,EAAE,MAAM;EAChB,WAAW,EAAE,WAAW;EACxB,UAAU,EAAE,UAAU;EACtB,aAAa,EAAE,UAAU;EACzB,eAAe,EAAE,mCAAmC;EACpD,SAAS,EAAE,SAAS;EACpB,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,OAAO;EAChB,OAAO,EAAE;AACX,CAAC;AAED,OAAO,MAAMC,kBAAkB,SAASL,uBAAuB,CAAqB;AAEpF,eAAe,MAAMM,aAAa,SAASP,kBAAkB,CAA8D;EAEzHQ,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,kBAAkB,CAAC,CAAC,EAAE,IAAII,kBAAkB,CAAC,CAAC,CAAC;IAACI,eAAA,mBAGtEC,KAAgC,IAAW;MACvD,IAAI,CAAC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,OAAO,EAAE;MAC/B,MAAM;QAAEC,SAAS;QAAEC,CAAC;QAAEC;MAAY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