{"dependencies":[{"name":"78f9fc7ed987bf72f0fae6b99573fddb.json","size":10993386,"url":"https://gw.alipayobjects.com/os/f6/85f52476-03ba-4281-b64f-6a68e3f05393/demo_interactive_hideitem/dependencies/herbox/78f9fc7ed987bf72f0fae6b99573fddb.json","ETag":"78F9FC7ED987BF72F0FAE6B99573FDDB","type":"json"},{"name":"0d7b758fdc47c7af5db47deeda4d99d4.json","size":5210534,"url":"https://gw.alipayobjects.com/os/f6/6f3fecd8-2ff6-41a2-a277-f44351aa3aab/demo_interactive_hideitem/dependencies/herbox/0d7b758fdc47c7af5db47deeda4d99d4.json","ETag":"0D7B758FDC47C7AF5DB47DEEDA4D99D4","type":"json"}],"sourceCode":{"app.js":"App({\n onLaunch(options) {\n // 第一次打开\n // options.query == {number:1}\n console.info('App onLaunch');\n },\n onShow(options) {\n // 从后台被 scheme 重新打开\n // options.query == {number:1}\n },\n});\n","app.json":"{\"window\":{\"defaultTitle\":\"F6移动端demo\",\"allowsBounceVertical\":\"NO\",\"canPullDown\":\"NO\"},\"pages\":[\"pages/Interactive/hideItem/index\"]}\n","mini.project.json":"{\n \"enableAppxNg\": true,\n \"component2\": true\n}","package.json":"{\n \"name\": \"f6demo\",\n \"version\": \"1.0.0\",\n \"description\": \"f6demo\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"dependencies\": {\n \"@antv/f6\": \"^0.0.12\",\n \"@antv/f6-alipay\": \"^0.0.2\",\n \"@babel/runtime\": \"^7.14.0\"\n },\n \"author\": \"\",\n \"license\": \"ISC\"\n}\n","pages/Interactive/hideItem/data.js":"export default {\n nodes: [\n { id: 'node0', size: 50, label: '0', x: 326, y: 268 },\n { id: 'node1', size: 30, label: '1', x: 280, y: 384 },\n { id: 'node2', size: 30, label: '2', x: 234, y: 167 },\n { id: 'node3', size: 30, label: '3', x: 391, y: 368 },\n { id: 'node4', size: 30, label: '4', x: 444, y: 209 },\n { id: 'node5', size: 30, label: '5', x: 378, y: 157 },\n { id: 'node6', size: 15, label: '6', x: 229, y: 400 },\n { id: 'node7', size: 15, label: '7', x: 281, y: 440 },\n { id: 'node8', size: 15, label: '8', x: 188, y: 119 },\n { id: 'node9', size: 15, label: '9', x: 287, y: 157 },\n { id: 'node10', size: 15, label: '10', x: 185, y: 200 },\n { id: 'node11', size: 15, label: '11', x: 238, y: 110 },\n { id: 'node12', size: 15, label: '12', x: 239, y: 221 },\n { id: 'node13', size: 15, label: '13', x: 176, y: 160 },\n { id: 'node14', size: 15, label: '14', x: 389, y: 423 },\n { id: 'node15', size: 15, label: '15', x: 441, y: 341 },\n { id: 'node16', size: 15, label: '16', x: 442, y: 398 },\n ],\n edges: [\n { source: 'node0', target: 'node1', label: '0-1' },\n { source: 'node0', target: 'node2', label: '0-2' },\n { source: 'node0', target: 'node3', label: '0-3' },\n { source: 'node0', target: 'node4', label: '0-4' },\n { source: 'node0', target: 'node5', label: '0-5' },\n { source: 'node1', target: 'node6', label: '1-6' },\n { source: 'node1', target: 'node7', label: '1-7' },\n { source: 'node2', target: 'node8', label: '2-8' },\n { source: 'node2', target: 'node9', label: '2-9' },\n { source: 'node2', target: 'node10', label: '2-10' },\n { source: 'node2', target: 'node11', label: '2-11' },\n { source: 'node2', target: 'node12', label: '2-12' },\n { source: 'node2', target: 'node13', label: '2-13' },\n { source: 'node3', target: 'node14', label: '3-14' },\n { source: 'node3', target: 'node15', label: '3-15' },\n { source: 'node3', target: 'node16', label: '3-16' },\n ],\n};\n","pages/Interactive/hideItem/index.acss":"/* required by usingComponents */","pages/Interactive/hideItem/index.axml":"<f6-canvas\n width=\"{{width}}\"\n height=\"{{height}}\"\n forceMini=\"{{forceMini}}\"\n pixelRatio=\"{{pixelRatio}}\"\n onTouchEvent=\"handleTouch\"\n onInit=\"handleInit\"\n></f6-canvas>","pages/Interactive/hideItem/index.js":"import F6 from '@antv/f6';\nimport { wrapContext } from '../../../utils/context';\nimport data from './data';\n\n/**\n * hideItem\n */\n\nPage({\n canvas: null,\n ctx: null,\n renderer: '', // mini、mini-native等,F6需要,标记环境\n isCanvasInit: false, // canvas是否准备好了\n graph: null,\n\n data: {\n width: 375,\n height: 600,\n pixelRatio: 2,\n forceMini: false,\n },\n\n onLoad() {\n // 同步获取window的宽高\n const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync();\n\n this.setData({\n width: windowWidth,\n height: windowHeight,\n pixelRatio,\n });\n },\n\n /**\n * 初始化cnavas回调,缓存获得的context\n * @param {*} ctx 绘图context\n * @param {*} rect 宽高信息\n * @param {*} canvas canvas对象,在render为mini时为null\n * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native\n */\n handleInit(ctx, rect, canvas, renderer) {\n this.isCanvasInit = true;\n this.ctx = wrapContext(ctx);\n this.renderer = renderer;\n this.canvas = canvas;\n this.updateChart();\n },\n\n /**\n * canvas派发的事件,转派给graph实例\n */\n handleTouch(e) {\n this.graph && this.graph.emitEvent(e);\n },\n\n updateChart() {\n const { width, height, pixelRatio } = this.data;\n // 创建F6实例\n this.graph = new F6.Graph({\n context: this.ctx,\n renderer: this.renderer,\n width,\n height,\n pixelRatio,\n fitView: true,\n fitViewPadding: 60,\n modes: {\n default: [\n 'drag-node',\n {\n type: 'drag-canvas',\n enableOptimize: true, // enable the optimize to hide the shapes beside nodes' keyShape\n },\n {\n type: 'zoom-canvas',\n enableOptimize: true, // enable the optimize to hide the shapes beside nodes' keyShape\n },\n ],\n },\n defaultNode: {\n size: [10, 10],\n style: {\n lineWidth: 2,\n fill: '#DEE9FF',\n stroke: '#5B8FF9',\n },\n },\n defaultEdge: {\n size: 1,\n style: {\n stroke: '#e2e2e2',\n lineAppendWidth: 2,\n },\n },\n nodeStateStyles: {\n yourStateName: {\n stroke: '#f00',\n lineWidth: 3,\n },\n },\n edgeStateStyles: {\n yourStateName: {\n stroke: '#f00',\n lineWidth: 3,\n },\n },\n });\n\n this.graph.data(data);\n this.graph.render();\n this.graph.fitView();\n },\n});\n","pages/Interactive/hideItem/index.json":"{\n \"defaultTitle\": \"hide Item\",\n \"usingComponents\": {\n \"f6-canvas\": \"@antv/f6-alipay/es/container/container\"\n }\n}\n","pages/Interactive/hideItem/index.less":"page {\n background-color: #f7f7f7;\n border: 1px solid rgba(0,0,0,0);\n box-sizing: border-box;\n}\n\n.page-section-demo {\n padding: 32rpx;\n}","utils/common.js":"function strLen(str = '') {\n let len = 0;\n for (let i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) {\n len += 1;\n } else {\n len += 2;\n }\n }\n\n return len;\n}\n\nfunction measureText(text, font) {\n let fontSize = 12;\n if (font) {\n fontSize = parseInt(font.split(' ')[3], 10);\n }\n fontSize /= 2;\n return {\n width: strLen(text) * fontSize,\n };\n}\n\nexport { measureText };\n","utils/context.js":"import { measureText } from './common';\n/**\n * 部分小程序context会缺少函数,补上\n */\nfunction wrapContext(ctx) {\n if (!ctx) return;\n if (!ctx.measureText) {\n ctx.measureText = measureText;\n }\n return ctx;\n}\n\nexport { wrapContext };\n"},"dist":[{"name":"57092a1ff412cb20ca43ce1906a94dc5.json","size":689379,"url":"https://gw.alipayobjects.com/os/f6/35fec72d-45bb-43b7-ba44-140c064e06dd/demo_interactive_hideitem/dist/herbox/57092a1ff412cb20ca43ce1906a94dc5.json","ETag":"57092A1FF412CB20CA43CE1906A94DC5","type":"json"}],"name":"pages/Interactive/hideItem/index","buildVersion":"0.72.7","remaxVersion":"2.0.3","component2":false,"css2":false}