{"bugs":{"url":"https://github.com/alibaba/rax/issues"},"dist":{"shasum":"02eeb8818ba00cf6621b99f9e7e4335434c9ce7d","tarball":"https://registry.npmjs.org/rax-canvas/-/rax-canvas-1.0.0-beta.2.tgz","fileCount":10,"integrity":"sha512-MbHfr6QW1KtFIi9sgUuTxv/vgwYYtAYQJFsIWzN2DZBgYL4AhkfoRIpndKGtHbgeXLwHDi0+eku7pQK4QOVuMA==","signatures":[{"sig":"MEYCIQCEwKnAnKd/OtIJSTME1M09SSpbhMIYVq2xCvFtUfTpyQIhAM+PVprUzJmtG13GyILEEoLybpgBUYyBjzdLe0tyv6wO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPsSgCRA9TVsSAnZWagAAgYkP+wZEwRn+XNuERf5Cxivn\niwMjHYq2sr0R1y+1Ykqjg5kDWdGWiOqwhrGGIKz/tSdIHHFk6/iScKGKIhg5\n14EUabpM23THjO3p8OVkvsGW6JWbsmePtEj0TmfIkZ0zFSfM33JIME9KxWWx\nzXWWGfT7S6cpmNHS1woZi3ruAuqLYo/+g/LI9PLKj59FKanNApPBMtJkEyp+\n6nfROvhVYlAAkdDj4/84ABrFN0WXXDYl1v8E2UZZcrkvpULQNJwSR1ovsG3x\ndFeuLqym9MLfm+WOlfMIHAt932mifRn3VziDXJhbbXH0Ull4YYwRRAcaVBOj\nF/mHZIvxyQaUD8gAhi6KJ84HDbs/C8RbRQbwmv0HwkFp1Hwv0KW2sHajhJV4\nR9lB2579OjYLQ3BR+ZRrgGHN3tu6xIsduJOSPGSdpFgA7fnkXn/LvFAcSH8B\nYjXgQQjyQ9TVOP8+ThFQjjV8P8n59Bj+uzZcpTmdeReIFTzvKtawPd5RxOTR\nEbcXDNTGLU1lPxP01P8xckTbyYaAy+KuKTHxs+9YOyEDG5wQUQ2GqEiNKMsY\nnWr+DngZfXKAk8zzzFJ1c2mHBvEt2Zg9xt+BbHmx9i+47xJ0MDn3fRxEAZCy\n8K4Y2GR5FF6ogGIzd89JqiZnw2CkL7FPwEHYzH38NAaz4Ik5vHUJBH2zbaJK\nyB6e\r\n=IRIQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"rax-canvas","readme":"[![npm](https://img.shields.io/npm/v/rax-canvas.svg)](https://www.npmjs.com/package/rax-canvas)\n**描述：**\nRax canvas api.\n\n> 在weex上依赖 [gcanvas](https://github.com/weex-plugins/weex-plugin-gcanvas)\n> 在小程序中依赖 [canvas](https://docs.alipay.com/mini/component/canvas)\n> 在weex和h5中需要通过ref获取canvas实例，在小程序中需要通过id获取\n\n## 安装\n\n```bash\n$ npm install rax-canvas --save\n```\n\n## 引用\n\n```jsx\nimport Canvas from 'rax-canvas';\n```\n## 属性\n注：\n1、**支持**列表中的 <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表h5 <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表weex  <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表小程序\n\n|**属性**| **类型** | **默认值** | **必填** | **描述**           | **支持** |\n| ----------- | ---------- | ---------- | ------------ | ------------------ | ------------ |\n| style | `object` |  -  | true |通过style中的width和height指定canvas的高、宽|<img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n## 方法\n获取到canvas示例后，具备canvas的通用方法\n## 示例\n[在线 Demo](https://jsplayground.taobao.org/raxplayground/ad464789-0503-4c6d-9e3c-4b9794b74809)\n```jsx\nimport { createElement, Component, render, createRef } from 'rax';\nimport Canvas from 'rax-canvas';\nimport DU from \"driver-universal\"\n\nclass CanvasSample extends Component {\n  constructor(props) {\n    super(props);\n    this.raxCanvasDemo = createRef()\n  }\n  componentDidMount() {\n    const context = this.raxCanvasDemo.current.getContext();\n    context.fillStyle = 'red';\n    context.fillRect(0, 0, 100, 100);\n  }\n\n  render() {\n    return <Canvas style={{\n      width: 750,\n      height: 750\n    }} ref={this.raxCanvasDemo} />;\n  }\n}\n\nrender(<CanvasSample />, document.body, { driver: DU });\n```\n\n\n","engines":{"npm":">=3.0.0"},"gitHead":"396dbd3518533142a221254a324db93448d0e12b","license":"BSD-3-Clause","scripts":{"lint":"eslint --ext .js --ext .jsx --ext .ts --ext .tsx ./src --fix","test":"rax-scripts test","build":"npm run clean && rax-scripts build --type 'component'","clean":"rm -rf ./lib && rm -rf ./package-lock.json","start":"rax-scripts start --type 'component' -p 8000","miniapp":"rax-scripts start --type 'component-miniapp'","prepublishOnly":"npm run build"},"_npmUser":{"name":"liangzhi.llz","email":"liangzhi.llz@alibaba-inc.com"},"homepage":"https://github.com/alibaba/rax#readme","keywords":["Rax","rax-component","react-component"],"repository":{"url":"git+https://github.com/raxjs/rax-canvas.git","type":"git"},"_npmVersion":"6.9.0","description":"canvas for Rax.","directories":{},"maintainers":[{"name":"liangzhi.llz","email":"liangzhi.llz@alibaba-inc.com"},{"name":"wintercn","email":"csf178@gmail.com"},{"name":"yacheng","email":"narutosun2@163.com"},{"name":"yuanyan","email":"yuanyan.cao@gmail.com"},{"name":"zeroling","email":"wssgcg1213@qq.com"}],"_nodeVersion":"8.11.1","dependencies":{"gcanvas.js":"^0.0.7","universal-env":"^0.6.5","rax-find-dom-node":"^1.0.0"},"miniappConfig":{"main":"lib/miniapp/index"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"rax":"^1.0.0","eslint":"^5.16.0","csstype":"^2.6.4","driver-dom":"^1.0.0","@types/jest":"^24.0.12","driver-weex":"^1.0.0","rax-scripts":"1.2.1","@rax-types/rax":"^1.0.5","@types/ali-app":"^1.0.0","driver-universal":"^1.0.0-beta.2","eslint-config-rax":"^0.0.0","rax-test-renderer":"^1.0.0","@typescript-eslint/parser":"^1.7.0","@typescript-eslint/eslint-plugin":"^1.7.0"},"peerDependencies":{"rax":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/rax-canvas_1.0.0-beta.2_1564394655482_0.8011432315256677","host":"s3://npm-registry-packages"},"_id":"rax-canvas@1.0.0-beta.2","version":"1.0.0-beta.2"}