02864d7726dd46bdb9a99ed3fe872f98.json 8.13 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _defineProperty2=_interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _reactNativeSvg=require(\"react-native-svg\");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(source,true).forEach(function(key){(0,_defineProperty2.default)(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(source).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}var Horizontal=function Horizontal(_ref){var _ref$ticks=_ref.ticks,ticks=_ref$ticks===void 0?[]:_ref$ticks,y=_ref.y,svg=_ref.svg;return _react.default.createElement(_reactNativeSvg.G,null,ticks.map(function(tick){return _react.default.createElement(_reactNativeSvg.Line,(0,_extends2.default)({key:tick,x1:'0%',x2:'100%',y1:y(tick),y2:y(tick),strokeWidth:1,stroke:'rgba(0,0,0,0.2)'},svg));}));};var Vertical=function Vertical(_ref2){var _ref2$ticks=_ref2.ticks,ticks=_ref2$ticks===void 0?[]:_ref2$ticks,x=_ref2.x,svg=_ref2.svg;return _react.default.createElement(_reactNativeSvg.G,null,ticks.map(function(tick,index){return _react.default.createElement(_reactNativeSvg.Line,(0,_extends2.default)({key:index,y1:'0%',y2:'100%',x1:x(tick),x2:x(tick),strokeWidth:1,stroke:'rgba(0,0,0,0.2)'},svg));}));};var Both=function Both(props){return _react.default.createElement(_reactNativeSvg.G,null,_react.default.createElement(Horizontal,props),_react.default.createElement(Vertical,props));};Vertical.propTypes={x:_propTypes.default.func,dataPoints:_propTypes.default.array,svg:_propTypes.default.object};Horizontal.propTypes={y:_propTypes.default.func,ticks:_propTypes.default.array};Both.propTypes=_objectSpread({},Vertical.propTypes,{},Horizontal.propTypes);var Direction={VERTICAL:'VERTICAL',HORIZONTAL:'HORIZONTAL',BOTH:'BOTH'};var Grid=function Grid(_ref3){var direction=_ref3.direction,props=(0,_objectWithoutProperties2.default)(_ref3,[\"direction\"]);if(direction===Direction.VERTICAL){return _react.default.createElement(Vertical,props);}else if(direction===Direction.HORIZONTAL){return _react.default.createElement(Horizontal,props);}else if(direction===Direction.BOTH){return _react.default.createElement(Both,props);}return null;};Grid.Direction=Direction;Grid.propTypes={direction:_propTypes.default.oneOf(Object.values(Direction)),belowChart:_propTypes.default.bool,svg:_propTypes.default.object};Grid.defaultProps={direction:Direction.HORIZONTAL,belowChart:true};var _default=Grid;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-svg-charts/src/grid.js"],"names":["Horizontal","ticks","y","svg","map","tick","Vertical","x","index","Both","props","propTypes","PropTypes","func","dataPoints","array","object","Direction","VERTICAL","HORIZONTAL","BOTH","Grid","direction","oneOf","Object","values","belowChart","bool","defaultProps"],"mappings":"icAAA,oDACA,6DACA,gD,yxBAEA,GAAMA,CAAAA,UAAU,CAAG,QAAbA,CAAAA,UAAa,MAA4B,qBAAzBC,KAAyB,CAAzBA,KAAyB,qBAAjB,EAAiB,YAAbC,CAAa,MAAbA,CAAa,CAAVC,GAAU,MAAVA,GAAU,CAC3C,MACI,8BAAC,iBAAD,MACKF,KAAK,CAACG,GAAN,CAAU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AAEW,mBAAUG,KAFE,CAAvB,CAKAN,IAAI,CAACE,SAAL,kBACOL,QAAQ,CAACK,SADhB,IAEOX,UAAU,CAACW,SAFlB,EAKA,GAAMM,CAAAA,SAAS,CAAG,CACdC,QAAQ,CAAE,UADI,CAEdC,UAAU,CAAE,YAFE,CAGdC,IAAI,CAAE,MAHQ,CAAlB,CAMA,GAAMC,CAAAA,IAAI,CAAG,QAAPA,CAAAA,IAAO,OAA6B,IAA1BC,CAAAA,SAA0B,OAA1BA,SAA0B,CAAZZ,KAAY,4DACtC,GAAIY,SAAS,GAAKL,SAAS,CAACC,QAA5B,CAAsC,CAClC,MAAO,8BAAC,QAAD,CAAcR,KAAd,CAAP,CACH,CAFD,IAEO,IAAIY,SAAS,GAAKL,SAAS,CAACE,UAA5B,CAAwC,CAC3C,MAAO,8BAAC,UAAD,CAAgBT,KAAhB,CAAP,CACH,CAFM,IAEA,IAAIY,SAAS,GAAKL,SAAS,CAACG,IAA5B,CAAkC,CACrC,MAAO,8BAAC,IAAD,CAAUV,KAAV,CAAP,CACH,CAED,MAAO,KAAP,CACH,CAVD,CAYAW,IAAI,CAACJ,SAAL,CAAiBA,SAAjB,CAEAI,IAAI,CAACV,SAAL,CAAiB,CACbW,SAAS,CAAEV,mBAAUW,KAAV,CAAgBC,MAAM,CAACC,MAAP,CAAcR,SAAd,CAAhB,CADE,CAEbS,UAAU,CAAEd,mBAAUe,IAFT,CAGbxB,GAAG,CAAES,mBAAUI,MAHF,CAAjB,CAMAK,IAAI,CAACO,YAAL,CAAoB,CAChBN,SAAS,CAAEL,SAAS,CAACE,UADL,CAEhBO,UAAU,CAAE,IAFI,CAApB,C,aAKeL,I","sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport { G, Line } from 'react-native-svg'\n\nconst Horizontal = ({ ticks = [], y, svg }) => {\n    return (\n        <G>\n            {ticks.map((tick) => (\n                <Line\n                    key={tick}\n                    x1={'0%'}\n                    x2={'100%'}\n                    y1={y(tick)}\n                    y2={y(tick)}\n                    strokeWidth={1}\n                    stroke={'rgba(0,0,0,0.2)'}\n                    {...svg}\n                />\n            ))}\n        </G>\n    )\n}\n\nconst Vertical = ({ ticks = [], x, svg }) => {\n    return (\n        <G>\n            {ticks.map((tick, index) => (\n                <Line\n                    key={index}\n                    y1={'0%'}\n                    y2={'100%'}\n                    x1={x(tick)}\n                    x2={x(tick)}\n                    strokeWidth={1}\n                    stroke={'rgba(0,0,0,0.2)'}\n                    {...svg}\n                />\n            ))}\n        </G>\n    )\n}\n\nconst Both = (props) => {\n    return (\n        <G>\n            <Horizontal {...props} />\n            <Vertical {...props} />\n        </G>\n    )\n}\n\nVertical.propTypes = {\n    x: PropTypes.func,\n    dataPoints: PropTypes.array,\n    svg: PropTypes.object,\n}\n\nHorizontal.propTypes = {\n    y: PropTypes.func,\n    ticks: PropTypes.array,\n}\n\nBoth.propTypes = {\n    ...Vertical.propTypes,\n    ...Horizontal.propTypes,\n}\n\nconst Direction = {\n    VERTICAL: 'VERTICAL',\n    HORIZONTAL: 'HORIZONTAL',\n    BOTH: 'BOTH',\n}\n\nconst Grid = ({ direction, ...props }) => {\n    if (direction === Direction.VERTICAL) {\n        return <Vertical {...props} />\n    } else if (direction === Direction.HORIZONTAL) {\n        return <Horizontal {...props} />\n    } else if (direction === Direction.BOTH) {\n        return <Both {...props} />\n    }\n\n    return null\n}\n\nGrid.Direction = Direction\n\nGrid.propTypes = {\n    direction: PropTypes.oneOf(Object.values(Direction)),\n    belowChart: PropTypes.bool,\n    svg: PropTypes.object,\n}\n\nGrid.defaultProps = {\n    direction: Direction.HORIZONTAL,\n    belowChart: true,\n}\n\nexport default Grid\n"]},"metadata":{},"sourceType":"script"}