@wavemaker/app-rn-runtime 11.4.2-rc.5389 → 11.4.2-rc.5398

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.
Files changed (49) hide show
  1. app-rn-runtime/components/basic/label/label.component.js +2 -1
  2. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  3. app-rn-runtime/components/basic/label/label.props.js +1 -0
  4. app-rn-runtime/components/basic/label/label.props.js.map +1 -1
  5. app-rn-runtime/components/chart/area-chart/area-chart.component.js +15 -10
  6. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  7. app-rn-runtime/components/chart/area-chart/area-chart.props.js +9 -1
  8. app-rn-runtime/components/chart/area-chart/area-chart.props.js.map +1 -1
  9. app-rn-runtime/components/chart/basechart.component.js +82 -39
  10. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  11. app-rn-runtime/components/chart/basechart.props.js +8 -3
  12. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  13. app-rn-runtime/components/chart/basechart.styles.js +25 -1
  14. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  15. app-rn-runtime/components/chart/line-chart/line-chart.component.js +31 -6
  16. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  17. app-rn-runtime/components/chart/line-chart/line-chart.props.js +1 -0
  18. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  19. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +23 -2
  20. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  21. app-rn-runtime/components/chart/pie-chart/pie-chart.props.js +1 -0
  22. app-rn-runtime/components/chart/pie-chart/pie-chart.props.js.map +1 -1
  23. app-rn-runtime/components/container/wizard/wizard.component.js +93 -2
  24. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  25. app-rn-runtime/components/container/wizard/wizard.props.js +4 -0
  26. app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
  27. app-rn-runtime/components/container/wizard/wizard.styles.js +103 -2
  28. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  29. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +1 -0
  30. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  31. app-rn-runtime/components/input/basenumber/basenumber.component.js +39 -5
  32. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  33. app-rn-runtime/components/input/basenumber/basenumber.props.js +1 -0
  34. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  35. app-rn-runtime/components/input/currency/currency.component.js +4 -1
  36. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  37. app-rn-runtime/components/input/number/number.component.js +4 -1
  38. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  39. app-rn-runtime/core/constant.service.js +22 -0
  40. app-rn-runtime/core/constant.service.js.map +1 -0
  41. app-rn-runtime/core/formatters.js +9 -2
  42. app-rn-runtime/core/formatters.js.map +1 -1
  43. app-rn-runtime/core/tappable.component.js +5 -2
  44. app-rn-runtime/core/tappable.component.js.map +1 -1
  45. app-rn-runtime/core/utils.js +16 -0
  46. app-rn-runtime/core/utils.js.map +1 -1
  47. app-rn-runtime/package.json +3 -3
  48. app-rn-runtime/runtime/App.js +16 -0
  49. app-rn-runtime/runtime/App.js.map +1 -1
@@ -57,7 +57,8 @@ export default class WmLabel extends BaseComponent {
57
57
  style: [this.styles.text, {
58
58
  color: props.isValid === false ? 'red' : this.styles.text.color
59
59
  }],
60
- numberOfLines: props.wrap ? undefined : 1,
60
+ ellipsizeMode: "tail",
61
+ numberOfLines: props.wrap ? undefined : props.nooflines,
61
62
  selectable: this.styles.text.userSelect === 'text'
62
63
  }, toString(props.caption), props.required && this.getAsterisk()))) : null;
63
64
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmLabelState","WmLabel","constructor","props","getAsterisk","createElement","style","styles","asterisk","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","text","fontSize","multilineskeleton","renderWidget","caption","entryanimation","animation","_background","target","color","isValid","numberOfLines","wrap","undefined","selectable","userSelect","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n }); \n }\n }\n\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption)? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text\n style={[this.styles.text, \n {color: props.isValid === false ? 'red' : this.styles.text.color}]}\n numberOfLines={props.wrap ? undefined : 1}\n selectable={this.styles.text.userSelect === 'text'}>\n {toString(props.caption)}\n {props.required && this.getAsterisk()}\n </Text>\n </Tappable>\n </Animatedview>\n ): null;\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAG3E,OAAO,MAAMC,YAAY,SAASR,kBAAkB,CAAe;AAInE,eAAe,MAAMS,OAAO,SAASV,aAAa,CAA4C;EAE5FW,WAAWA,CAACC,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,CAAC;EACjD;EAEQU,WAAWA,CAAA,EAAI;IACrB,oBAAOhB,KAAA,CAAAiB,aAAA,CAAChB,IAAI;MAACiB,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAS,GAAC,GAAO,CAAC;EACpD;EAEQC,oBAAoBA,CAACC,KAAU,EAAEC,MAAW,EAAE;IACpD,MAAMJ,MAAM,GAAG;MACbK,YA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,YAAYA,CAACxB,KAAmB,EAAE;IAChC,OAAO,CAACP,KAAK,CAACO,KAAK,CAACyB,OAAO,CAAC,gBAC1BxC,KAAA,CAAAiB,aAAA,CAACP,YAAY;MAAC+B,cAAc,EAAE1B,KAAK,CAAC2B,SAAU;MAACxB,KAAK,EAAE,IAAI,CAACC,MAAM,CAACc;IAAK,GACpE,IAAI,CAACU,WAAW,eACjB3C,KAAA,CAAAiB,aAAA,CAACZ,QAAQ;MAACuC,MAAM,EAAE;IAAK,gBACnB5C,KAAA,CAAAiB,aAAA,CAAChB,IAAI;MACHiB,KAAK,EAAE,CAAC,IAAI,CAACC,MAAM,CAACiB,IAAI,EACtB;QAACS,KAAK,EAAE9B,KAAK,CAAC+B,OAAO,KAAK,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC3B,MAAM,CAACiB,IAAI,CAACS;MAAK,CAAC,CAAE;MACrEE,aAAa,EAAEhC,KAAK,CAACiC,IAAI,GAAGC,SAAS,GAAG,CAAE;MAC1CC,UAAU,EAAE,IAAI,CAAC/B,MAAM,CAACiB,IAAI,CAACe,UAAU,KAAK;IAAO,GAClD1C,QAAQ,CAACM,KAAK,CAACyB,OAAO,CAAC,EACvBzB,KAAK,CAACqC,QAAQ,IAAI,IAAI,CAACpC,WAAW,CAAC,CAChC,CACA,CACE,CAAC,GACd,IAAI;EACT;AACF"}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmLabelState","WmLabel","constructor","props","getAsterisk","createElement","style","styles","asterisk","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","text","fontSize","multilineskeleton","renderWidget","caption","entryanimation","animation","_background","target","color","isValid","ellipsizeMode","numberOfLines","wrap","undefined","nooflines","selectable","userSelect","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n }); \n }\n }\n\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption)? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text\n style={[this.styles.text, \n {color: props.isValid === false ? 'red' : this.styles.text.color}]}\n ellipsizeMode=\"tail\"\n numberOfLines={props.wrap ? undefined : props.nooflines}\n selectable={this.styles.text.userSelect === 'text'}>\n {toString(props.caption)}\n {props.required && this.getAsterisk()}\n </Text>\n </Tappable>\n </Animatedview>\n ): null;\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAG3E,OAAO,MAAMC,YAAY,SAASR,kBAAkB,CAAe;AAInE,eAAe,MAAMS,OAAO,SAASV,aAAa,CAA4C;EAE5FW,WAAWA,CAACC,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,CAAC;EACjD;EAEQU,WAAWA,CAAA,EAAI;IACrB,oBAAOhB,KAAA,CAAAiB,aAAA,CAAChB,IAAI;MAACiB,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAS,GAAC,GAAO,CAAC;EACpD;EAEQC,oBAAoBA,CAACC,KAAU,EAAEC,MAAW,EAAE;IACpD,MAAMJ,MAAM,GAAG;MACbK,YAAY,EAAC,CAAC;MACdC,YAAY,EAAE,EAAE;MAChBF,MAAM,EAAEA;IACV,CAAC;IACD,OAAOZ,cAAc,CAAC,IAAI,CAACe,KAAK,EAAE,IAAI,CAACP,MAAM,CAACQ,QAAQ,EAAE;MACtD,GAAGR,MAAM;MACTG,KAAK,EAAEA,KAAK;MACZC,MAAM,EAAEA;IACV,CAAC,CAAC;EACJ;EAEOK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,KAAA,CAAAiB,aAAA,CAACZ,QAAQ;MAACuC,MAAM,EAAE;IAAK,gBACnB5C,KAAA,CAAAiB,aAAA,CAAChB,IAAI;MACHiB,KAAK,EAAE,CAAC,IAAI,CAACC,MAAM,CAACiB,IAAI,EACtB;QAACS,KAAK,EAAE9B,KAAK,CAAC+B,OAAO,KAAK,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC3B,MAAM,CAACiB,IAAI,CAACS;MAAK,CAAC,CAAE;MACrEE,aAAa,EAAC,MAAM;MACpBC,aAAa,EAAEjC,KAAK,CAACkC,IAAI,GAAGC,SAAS,GAAGnC,KAAK,CAACoC,SAAU;MACxDC,UAAU,EAAE,IAAI,CAACjC,MAAM,CAACiB,IAAI,CAACiB,UAAU,KAAK;IAAO,GAClD5C,QAAQ,CAACM,KAAK,CAACyB,OAAO,CAAC,EACvBzB,KAAK,CAACuC,QAAQ,IAAI,IAAI,CAACtC,WAAW,CAAC,CAChC,CACA,CACE,CAAC,GACd,IAAI;EACT;AACF"}
@@ -13,6 +13,7 @@ export default class WmLabelProps extends BaseProps {
13
13
  _defineProperty(this, "skeletonheight", null);
14
14
  _defineProperty(this, "skeletonwidth", null);
15
15
  _defineProperty(this, "multilineskeleton", false);
16
+ _defineProperty(this, "nooflines", 1);
16
17
  }
17
18
  }
18
19
  //# sourceMappingURL=label.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmLabelProps","constructor","arguments","_defineProperty"],"sources":["label.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmLabelProps extends BaseProps {\n animation?: string = null as any;\n caption?: string = 'Label';\n required?: boolean = null as any;\n isValid?: boolean = true;\n wrap?: boolean = true;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n multilineskeleton?: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC3B,IAAI;IAAAA,eAAA,kBACN,OAAO;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,kBACL,IAAI;IAAAA,eAAA,eACP,IAAI;IAAAA,eAAA,yBACK,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,4BACC,KAAK;EAAA;AACvC"}
1
+ {"version":3,"names":["BaseProps","WmLabelProps","constructor","arguments","_defineProperty"],"sources":["label.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmLabelProps extends BaseProps {\n animation?: string = null as any;\n caption?: string = 'Label';\n required?: boolean = null as any;\n isValid?: boolean = true;\n wrap?: boolean = true;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n multilineskeleton?: boolean = false;\n nooflines? = 1;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC3B,IAAI;IAAAA,eAAA,kBACN,OAAO;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,kBACL,IAAI;IAAAA,eAAA,eACP,IAAI;IAAAA,eAAA,yBACK,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,4BACC,KAAK;IAAAA,eAAA,oBACtB,CAAC;EAAA;AAClB"}
@@ -2,12 +2,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
2
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
4
  import React from 'react';
5
+ import Color from "color";
5
6
  import { View } from 'react-native';
6
7
  import { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';
7
8
  import { VictoryArea, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from "victory-native";
8
9
  import WmAreaChartProps from './area-chart.props';
9
10
  import { DEFAULT_CLASS } from './area-chart.styles';
10
11
  import { BaseChartComponent, BaseChartComponentState } from "@wavemaker/app-rn-runtime/components/chart/basechart.component";
12
+ import { isNumber } from 'lodash-es';
11
13
  export class WmAreaChartState extends BaseChartComponentState {
12
14
  constructor() {
13
15
  super(...arguments);
@@ -30,10 +32,14 @@ export default class WmAreaChart extends BaseChartComponent {
30
32
  return null;
31
33
  }
32
34
  let mindomain = {
33
- x: this.props.xdomain === 'Min' ? this.state.chartMinX : undefined,
34
- y: this.props.ydomain === 'Min' ? this.state.chartMinY : undefined
35
+ x: props.xdomain === 'Min' ? this.state.chartMinX : undefined,
36
+ y: props.ydomain === 'Min' ? this.state.chartMinY : undefined
35
37
  };
36
38
  const chartName = this.props.name ?? 'nonameAreachart';
39
+ let gradientStop = '100%';
40
+ if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {
41
+ gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';
42
+ }
37
43
  return /*#__PURE__*/React.createElement(View, {
38
44
  style: this.styles.root,
39
45
  onLayout: this.onViewLayoutChange.bind(this)
@@ -45,7 +51,7 @@ export default class WmAreaChart extends BaseChartComponent {
45
51
  top: 70,
46
52
  bottom: 50,
47
53
  left: 50,
48
- right: 50
54
+ right: 30
49
55
  },
50
56
  minDomain: mindomain
51
57
  }, /*#__PURE__*/React.createElement(VictoryLegend, {
@@ -67,18 +73,18 @@ export default class WmAreaChart extends BaseChartComponent {
67
73
  y2: "100%"
68
74
  }, /*#__PURE__*/React.createElement(Stop, {
69
75
  offset: "0%",
70
- stopColor: this.state.colors[i]
76
+ stopColor: Color(this.state.colors[i]).lighten(0.2).rgb().toString()
71
77
  }), /*#__PURE__*/React.createElement(Stop, {
72
- offset: "100%",
73
- stopColor: '#ffffff00',
74
- stopOpacity: "0"
78
+ offset: gradientStop,
79
+ stopColor: Color(this.state.colors[i]).lighten(0.6).rgb().toString()
75
80
  }))), /*#__PURE__*/React.createElement(VictoryArea, {
76
81
  interpolation: props.interpolation,
77
82
  key: props.name + '_' + i,
78
83
  style: {
79
84
  data: {
80
85
  fill: `url(#${chartName}Gradient${i})`,
81
- stroke: this.state.colors[i]
86
+ stroke: this.state.colors[i],
87
+ strokeWidth: props.linethickness
82
88
  }
83
89
  },
84
90
  data: d
@@ -87,8 +93,7 @@ export default class WmAreaChart extends BaseChartComponent {
87
93
  key: props.name + '_scatter' + i,
88
94
  style: {
89
95
  data: {
90
- fill: this.state.colors[i],
91
- opacity: 0.8
96
+ fill: Color(this.state.colors[i]).darken(0.2).rgb().toString()
92
97
  }
93
98
  },
94
99
  data: d
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Defs","LinearGradient","Stop","Svg","VictoryArea","VictoryChart","VictoryLegend","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmAreaChartState","constructor","arguments","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","renderWidget","_this$state$data","state","data","length","mindomain","x","xdomain","chartMinX","undefined","y","ydomain","chartMinY","chartName","name","createElement","style","styles","root","onLayout","onViewLayoutChange","bind","theme","height","padding","top","bottom","left","right","minDomain","containerComponent","title","subheading","orientation","gutter","getLegendView","getXaxis","getYAxis","map","d","i","key","id","x1","y1","x2","y2","offset","stopColor","colors","stopOpacity","interpolation","fill","stroke","highlightpoints","size","opacity"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\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 this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n renderWidget(props: WmAreaChartProps) {\n if (!this.state.data?.length) {\n return null;\n }\n let mindomain={\n x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n const chartName = this.props.name ?? 'nonameAreachart';\n return (\n <View\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n {this.state.chartWidth ? \n (\n <VictoryChart\n theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.state.chartWidth || 120}\n padding={{ top: 70, bottom: 50, left: 50, right: 50 }}\n minDomain={mindomain}\n > \n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={this.state.colors[i]}/>\n <Stop offset=\"100%\" stopColor={'#ffffff00'} stopOpacity=\"0\"/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i]\n }\n }}\n data={d}\n />\n {props.highlightpoints ?\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: { fill: this.state.colors[i], opacity: 0.8}\n }}\n data={d}/>\n : null}\n </VictoryGroup>\n })\n }\n </VictoryStack>\n </VictoryChart>\n )\n : null}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAQ,cAAc;AACtD,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,EAAEC,GAAG,QAAQ,kBAAkB;AAClE,SAASC,WAAW,EAAEC,YAAY,EAAEC,aAAa,EAAEC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAErH,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AAEvE,OAAO,MAAMC,gBAAgB,SAASD,uBAAuB,CAAmB;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,qBACjE,CAAC;EAAA;AAChB;AAEA,eAAe,MAAMC,WAAW,SAASN,kBAAkB,CAAwD;EAEjHG,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAII,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA,6BAGxDG,CAAoB,IAAK;MAC7C,IAAIC,SAAS,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM,CAACC,KAAK;MAC1C,IAAI,CAACC,WA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AAE3D,KAAK,CAAC2D,aAAuC;QAC5DV,GAAG,EAAEjD,KAAK,CAACsB,IAAI,GAAG,GAAG,GAAG0B,CAAE;QAC1BxB,KAAK,EAAE;UACLb,IAAI,EAAE;YACJiD,IAAI,EAAG,QAAOvC,SAAU,WAAU2B,CAAE,GAAE;YACtCa,MAAM,EAAE,IAAI,CAACnD,KAAK,CAAC+C,MAAM,CAACT,CAAC;UAC7B;QACF,CAAE;QACFrC,IAAI,EAAEoC;MAAE,CACT,CAAC,EACD/C,KAAK,CAAC8D,eAAe,gBACpBnF,KAAA,CAAA4C,aAAA,CAAClC,cAAc;QACb0E,IAAI,EAAE,CAAE;QACRd,GAAG,EAAEjD,KAAK,CAACsB,IAAI,GAAG,UAAU,GAAG0B,CAAE;QACjCxB,KAAK,EAAE;UACLb,IAAI,EAAE;YAAEiD,IAAI,EAAE,IAAI,CAAClD,KAAK,CAAC+C,MAAM,CAACT,CAAC,CAAC;YAAEgB,OAAO,EAAE;UAAG;QAClD,CAAE;QACFrD,IAAI,EAAEoC;MAAE,CAAC,CAAC,GACZ,IACU,CAAC;IACjB,CAAC,CAEW,CACF,CAAC,GAEjB,IACE,CAAC;EACT;AACF"}
1
+ {"version":3,"names":["React","Color","View","Defs","LinearGradient","Stop","Svg","VictoryArea","VictoryChart","VictoryLegend","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","isNumber","WmAreaChartState","constructor","arguments","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","renderWidget","_this$state$data","state","data","length","mindomain","x","xdomain","chartMinX","undefined","y","ydomain","chartMinY","chartName","name","gradientStop","chartMaxY","createElement","style","styles","root","onLayout","onViewLayoutChange","bind","theme","height","padding","top","bottom","left","right","minDomain","containerComponent","title","subheading","orientation","gutter","getLegendView","getXaxis","getYAxis","map","d","i","key","id","x1","y1","x2","y2","offset","stopColor","colors","lighten","rgb","toString","interpolation","fill","stroke","strokeWidth","linethickness","highlightpoints","size","darken"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport Color from \"color\";\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryLine, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { isNil, isNumber } from 'lodash-es';\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\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 this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n renderWidget(props: WmAreaChartProps) {\n if (!this.state.data?.length) {\n return null;\n }\n let mindomain={\n x: props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n const chartName = this.props.name ?? 'nonameAreachart';\n let gradientStop = '100%';\n if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {\n gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';\n }\n return (\n <View\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n {this.state.chartWidth ? \n (\n <VictoryChart\n theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.state.chartWidth || 120}\n padding={{ top: 70, bottom: 50, left: 50, right: 30 }}\n minDomain={mindomain}\n > \n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={Color(this.state.colors[i]).lighten(0.2).rgb().toString()}/>\n <Stop offset={gradientStop} stopColor={Color(this.state.colors[i]).lighten(0.6).rgb().toString()}/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i],\n strokeWidth: props.linethickness,\n }\n }}\n data={d}\n />\n {props.highlightpoints ?\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: { \n fill: Color(this.state.colors[i]).darken(0.2).rgb().toString()}\n }} \n data={d}\n />\n : null}\n </VictoryGroup>\n })\n }\n </VictoryStack>\n </VictoryChart>\n )\n : null}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAc,cAAc;AAC5D,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,EAAEC,GAAG,QAAQ,kBAAkB;AAClE,SAASC,WAAW,EAAeC,YAAY,EAAEC,aAAa,EAAEC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAElI,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2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,IAAI,EAAE;YACJqD,IAAI,EAAG,QAAO3C,SAAU,WAAU6B,CAAE,GAAE;YACtCe,MAAM,EAAE,IAAI,CAACvD,KAAK,CAACiD,MAAM,CAACT,CAAC,CAAC;YAC5BgB,WAAW,EAAElE,KAAK,CAACmE;UACrB;QACF,CAAE;QACFxD,IAAI,EAAEsC;MAAE,CACT,CAAC,EACDjD,KAAK,CAACoE,eAAe,gBACpB3F,KAAA,CAAAgD,aAAA,CAACrC,cAAc;QACbiF,IAAI,EAAE,CAAE;QACRlB,GAAG,EAAEnD,KAAK,CAACsB,IAAI,GAAG,UAAU,GAAG4B,CAAE;QACjCxB,KAAK,EAAE;UACLf,IAAI,EAAE;YACJqD,IAAI,EAAEtF,KAAK,CAAC,IAAI,CAACgC,KAAK,CAACiD,MAAM,CAACT,CAAC,CAAC,CAAC,CAACoB,MAAM,CAAC,GAAG,CAAC,CAACT,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC;UAAC;QAClE,CAAE;QACFnD,IAAI,EAAEsC;MAAE,CACP,CAAC,GACJ,IACU,CAAC;IACjB,CAAC,CAEW,CACF,CAAC,GAEjB,IACE,CAAC;EACT;AACF"}
@@ -1,3 +1,11 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
4
  import BaseChartComponentProps from "@wavemaker/app-rn-runtime/components/chart/basechart.props";
2
- export default class WmAreaChartProps extends BaseChartComponentProps {}
5
+ export default class WmAreaChartProps extends BaseChartComponentProps {
6
+ constructor() {
7
+ super(...arguments);
8
+ _defineProperty(this, "linethickness", 2);
9
+ }
10
+ }
3
11
  //# sourceMappingURL=area-chart.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseChartComponentProps","WmAreaChartProps"],"sources":["area-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from \"@wavemaker/app-rn-runtime/components/chart/basechart.props\";\n\nexport default class WmAreaChartProps extends BaseChartComponentProps {\n\n}\n"],"mappings":"AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,gBAAgB,SAASD,uBAAuB,CAAC"}
1
+ {"version":3,"names":["BaseChartComponentProps","WmAreaChartProps","constructor","arguments","_defineProperty"],"sources":["area-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from \"@wavemaker/app-rn-runtime/components/chart/basechart.props\";\n\nexport default class WmAreaChartProps extends BaseChartComponentProps {\n linethickness: number = 2;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,gBAAgB,SAASD,uBAAuB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,wBAC1C,CAAC;EAAA;AAC7B"}
@@ -84,12 +84,13 @@ export class BaseChartComponent extends BaseComponent {
84
84
  if (this.state.props.showlegend === 'hide') {
85
85
  return null;
86
86
  }
87
- let top = this.props.showlegend === 'bottom' ? parseInt(this.styles.root.height) : 0;
87
+ const props = this.state.props;
88
+ let top = props.showlegend === 'bottom' ? parseInt(this.styles.root.height) : 0;
88
89
  if (top) {
89
90
  top = top - 50; // remove legendHeight
90
91
  }
91
92
 
92
- const orientation = this.props.showlegend === 'right' || this.props.showlegend === 'left' ? 'vertical' : 'horizontal';
93
+ const orientation = props.showlegend === 'right' || props.showlegend === 'left' ? 'vertical' : 'horizontal';
93
94
  return /*#__PURE__*/React.createElement(VictoryLegend, {
94
95
  colorScale: colorScale,
95
96
  name: 'legendData',
@@ -114,39 +115,75 @@ export class BaseChartComponent extends BaseComponent {
114
115
  }
115
116
  // x axis with vertical lines having grid stroke colors
116
117
  getXaxis() {
117
- if (this.props.showxaxis === false) {
118
- return null;
119
- }
118
+ const minIndex = 0;
119
+ const maxIndex = this.state.xaxisDatakeyArr.length - 1;
120
+ const props = this.state.props;
121
+ const getTickValueLabel = props.xtickexpr;
120
122
  return /*#__PURE__*/React.createElement(VictoryAxis, {
121
- crossAxis: true,
122
- label: (this.props.xaxislabel || this.props.xaxisdatakey) + (this.props.xunits ? `(${this.props.xunits})` : ''),
123
+ crossAxis: false,
124
+ label: (props.xaxislabel || props.xaxisdatakey || "name") + (props.xunits ? `(${props.xunits})` : ''),
123
125
  style: {
124
- grid: this.styles.grid
126
+ axisLabel: this.theme.mergeStyle(this.styles.axisLabel, this.styles.yAxisLabel, {
127
+ padding: props.yaxislabeldistance
128
+ }),
129
+ grid: props.hidegridxaxis ? {
130
+ stroke: null
131
+ } : this.theme.mergeStyle(this.styles.grid, this.styles.xGrid),
132
+ axis: props.showxaxis === false ? {
133
+ stroke: 'none'
134
+ } : this.theme.mergeStyle(this.styles.axis, this.styles.xAxis),
135
+ ticks: this.theme.mergeStyle(this.styles.ticks, this.styles.xTicks),
136
+ tickLabels: this.theme.mergeStyle(this.styles.tickLabels, this.styles.xTickLabels)
125
137
  },
126
- fixLabelOverlap: true,
138
+ fixLabelOverlap: props.autoadjustlabels ? true : false,
127
139
  tickLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, {
128
- angle: this.props.labelangle || 0
140
+ angle: props.labelangle || 0
129
141
  }),
130
142
  theme: this.state.theme,
131
- tickFormat: d => `${this.state.xaxisDatakeyArr.length ? this.state.xaxisDatakeyArr[d] : d}`
143
+ tickCount: this.state.xaxisDatakeyArr.length,
144
+ invertAxis: this.isRTL,
145
+ tickFormat: (d, i, ticks) => {
146
+ if (getTickValueLabel) {
147
+ return getTickValueLabel(this.state.xaxisDatakeyArr[d], i, (ticks || []).length);
148
+ } else if (this.state.xaxisDatakeyArr) {
149
+ return this.state.xaxisDatakeyArr[d];
150
+ }
151
+ return '';
152
+ }
132
153
  });
133
154
  }
155
+
134
156
  /* y axis with horizontal lines having grid stroke colors*/
135
157
  getYAxis() {
136
- if (this.props.showyaxis === false) {
158
+ const props = this.state.props;
159
+ if (props.showyaxis === false) {
137
160
  return null;
138
161
  }
162
+ const getTickValueLabel = props.ytickexpr;
139
163
  return /*#__PURE__*/React.createElement(VictoryAxis, {
140
- crossAxis: true,
141
- label: (this.props.yaxislabel || this.props.yaxisdatakey) + (this.props.yunits ? `(${this.props.yunits})` : ''),
164
+ crossAxis: false,
165
+ label: (props.yaxislabel || props.yaxisdatakey) + (props.yunits ? `(${props.yunits})` : ''),
142
166
  style: {
143
- axisLabel: {
144
- padding: this.props.yaxislabeldistance
145
- },
146
- grid: this.styles.grid
167
+ axisLabel: this.theme.mergeStyle(this.styles.axisLabel, this.styles.yAxisLabel, {
168
+ padding: props.yaxislabeldistance
169
+ }),
170
+ grid: props.hidegridyaxis ? {
171
+ stroke: null
172
+ } : this.theme.mergeStyle(this.styles.grid, this.styles.yGrid),
173
+ axis: props.showxaxis === false ? {
174
+ stroke: 'none'
175
+ } : this.theme.mergeStyle(this.styles.axis, this.styles.yAxis),
176
+ ticks: this.theme.mergeStyle(this.styles.ticks, this.styles.yTicks),
177
+ tickLabels: this.theme.mergeStyle(this.styles.tickLabels, this.styles.yTickLabels)
147
178
  },
179
+ fixLabelOverlap: props.autoadjustlabels ? true : false,
148
180
  theme: this.state.theme,
149
- tickFormat: t => `${this.abbreviateNumber(t)}`,
181
+ tickFormat: (d, i, ticks) => {
182
+ if (getTickValueLabel) {
183
+ return getTickValueLabel(d, i, (ticks || []).length);
184
+ }
185
+ return this.abbreviateNumber(d);
186
+ },
150
187
  dependentAxis: true
151
188
  });
152
189
  }
@@ -158,7 +195,8 @@ export class BaseChartComponent extends BaseComponent {
158
195
 
159
196
  // Check whether X/Y Domain was set to Min and is supported for the present chart
160
197
  isAxisDomainValid(axis) {
161
- if (get(this.props, axis + 'domain') === 'Min' && this.isAxisDomainSupported(this.props.type)) {
198
+ const props = this.state.props;
199
+ if (get(props, axis + 'domain') === 'Min' && this.isAxisDomainSupported(props.type)) {
162
200
  return true;
163
201
  }
164
202
  return false;
@@ -208,7 +246,7 @@ export class BaseChartComponent extends BaseComponent {
208
246
  }
209
247
  const xValues = {};
210
248
  /*
211
- compute the min x value
249
+ compute the min x valuex
212
250
  eg: When data has objects
213
251
  input: [{x:1, y:2}, {x:2, y:3}, {x:3, y:4}]
214
252
  min x: 1
@@ -300,7 +338,7 @@ export class BaseChartComponent extends BaseComponent {
300
338
  if (!colorsToUse.length) {
301
339
  colorsToUse = ThemeFactory.getColorsObj(themeName);
302
340
  }
303
- themeToUse = ThemeFactory.getTheme(themeName, this.props.styles, colorsToUse);
341
+ themeToUse = ThemeFactory.getTheme(themeName, props.styles, colorsToUse);
304
342
  } else if (typeof themeName === 'object') {
305
343
  // if theme is passed as an object then use that custom theme.
306
344
  themeToUse = props.theme;
@@ -311,9 +349,10 @@ export class BaseChartComponent extends BaseComponent {
311
349
  });
312
350
  }
313
351
  prepareLegendData() {
352
+ const props = this.state.props;
314
353
  if (this.state.yAxis) {
315
354
  let ldata;
316
- if (this.props.type === 'Stack') {
355
+ if (props.type === 'Stack') {
317
356
  const data = orderBy(this.state.data[0], 'y', 'asc');
318
357
  ldata = data.map(d => {
319
358
  return {
@@ -366,8 +405,9 @@ export class BaseChartComponent extends BaseComponent {
366
405
  return value;
367
406
  }
368
407
  prepareDataItems(dataset) {
369
- let xaxis = this.props.xaxisdatakey;
370
- let yaxis = this.props.yaxisdatakey;
408
+ const props = this.state.props;
409
+ let xaxis = props.xaxisdatakey;
410
+ let yaxis = props.yaxisdatakey;
371
411
  let xaxisDatakeyArr = [];
372
412
  let datasets = [];
373
413
  if (xaxis && yaxis) {
@@ -384,11 +424,11 @@ export class BaseChartComponent extends BaseComponent {
384
424
  x: xVal,
385
425
  y: yVal
386
426
  };
387
- if (this.props.bubblesize) {
388
- set(dataObj, 'size', get(o, this.props.bubblesize, 5));
427
+ if (props.bubblesize) {
428
+ set(dataObj, 'size', get(o, props.bubblesize, 5));
389
429
  }
390
- if (this.props.shape) {
391
- set(dataObj, 'symbol', shapes[this.props.shape]);
430
+ if (props.shape) {
431
+ set(dataObj, 'symbol', shapes[props.shape]);
392
432
  }
393
433
  return dataObj;
394
434
  }));
@@ -396,7 +436,7 @@ export class BaseChartComponent extends BaseComponent {
396
436
  });
397
437
  // chartTransform
398
438
  this.invokeEventCallback('onTransform', [undefined, this.proxy]);
399
- if (this.props.type == 'Pie' || this.props.type === 'Donut') {
439
+ if (props.type == 'Pie' || props.type === 'Donut') {
400
440
  // for animation effect
401
441
  setTimeout(() => {
402
442
  this.updateState({
@@ -408,23 +448,25 @@ export class BaseChartComponent extends BaseComponent {
408
448
  }
409
449
  }
410
450
  renderLoadingIcon() {
451
+ const props = this.state.props;
411
452
  return /*#__PURE__*/React.createElement(WmIcon, {
412
453
  styles: this.styles.loadingIcon,
413
- iconclass: this.props.loadingicon,
414
- caption: this.props.loadingdatamsg
454
+ iconclass: props.loadingicon,
455
+ caption: props.loadingdatamsg
415
456
  });
416
457
  }
417
458
  updateData(datasets, yPts, xaxisDatakeyArr) {
459
+ const props = this.state.props;
418
460
  this.updateState({
419
461
  data: datasets,
420
462
  yAxis: yPts,
421
463
  xaxisDatakeyArr: xaxisDatakeyArr
422
464
  }, () => {
423
465
  this.prepareLegendData();
424
- if (!this.props.labeltype || this.props.labeltype === 'percent') {
466
+ if (!props.labeltype || props.labeltype === 'percent') {
425
467
  this.setTotal(this.state.data[0]);
426
468
  }
427
- if (this.isAxisDomainSupported(this.props.type) && (this.props.ydomain || this.props.xdomain)) {
469
+ if (this.isAxisDomainSupported(props.type) && (props.ydomain || props.xdomain)) {
428
470
  this.setDomainValues();
429
471
  }
430
472
  this.updateState({
@@ -443,6 +485,7 @@ export class BaseChartComponent extends BaseComponent {
443
485
  }
444
486
  onPropertyChange(name, $new, $old) {
445
487
  super.onPropertyChange(name, $new, $old);
488
+ const props = this.state.props;
446
489
  let units = '';
447
490
  switch (name) {
448
491
  case 'customcolors':
@@ -457,7 +500,7 @@ export class BaseChartComponent extends BaseComponent {
457
500
  });
458
501
  break;
459
502
  case 'theme':
460
- this.applyTheme(this.props);
503
+ this.applyTheme(props);
461
504
  break;
462
505
  case 'dataset':
463
506
  if (!isArray($new)) {
@@ -470,16 +513,16 @@ export class BaseChartComponent extends BaseComponent {
470
513
  $new && this.prepareDataItems($new);
471
514
  break;
472
515
  case 'xaxislabel':
473
- if (this.props.xunits) {
474
- units = ' (' + this.props.xunits + ')';
516
+ if (props.xunits) {
517
+ units = ' (' + props.xunits + ')';
475
518
  }
476
519
  this.updateState({
477
520
  xLabel: $new + units
478
521
  });
479
522
  break;
480
523
  case 'yaxislabel':
481
- if (this.props.yunits) {
482
- units = ' (' + this.props.yunits + ')';
524
+ if (props.yunits) {
525
+ units = ' (' + props.yunits + ')';
483
526
  }
484
527
  this.updateState({
485
528
  yLabel: $new + units