{"dependencies":[{"name":"78f9fc7ed987bf72f0fae6b99573fddb.json","size":10993386,"url":"https://gw.alipayobjects.com/os/f6/dbc1d37b-035d-4b0e-850f-c3f7281757dd/demo_generalgraph_basiccomboforce/dependencies/herbox/78f9fc7ed987bf72f0fae6b99573fddb.json","ETag":"78F9FC7ED987BF72F0FAE6B99573FDDB","type":"json"},{"name":"0d7b758fdc47c7af5db47deeda4d99d4.json","size":5210534,"url":"https://gw.alipayobjects.com/os/f6/fe5aa2db-6761-4e7b-8064-9d1923a53c04/demo_generalgraph_basiccomboforce/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/GeneralGraph/basicComboForce/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/GeneralGraph/basicComboForce/data.js":"export default {\n nodes: [\n {\n id: '0',\n comboId: 'a',\n },\n {\n id: '1',\n comboId: 'a',\n },\n {\n id: '2',\n comboId: 'a',\n },\n {\n id: '3',\n comboId: 'a',\n },\n {\n id: '4',\n comboId: 'a',\n },\n {\n id: '5',\n comboId: 'a',\n },\n {\n id: '6',\n comboId: 'a',\n },\n {\n id: '7',\n comboId: 'a',\n },\n {\n id: '8',\n comboId: 'a',\n },\n {\n id: '9',\n comboId: 'a',\n },\n {\n id: '10',\n comboId: 'a',\n },\n {\n id: '11',\n comboId: 'a',\n },\n {\n id: '12',\n comboId: 'a',\n },\n {\n id: '13',\n comboId: 'a',\n },\n {\n id: '14',\n comboId: 'a',\n },\n {\n id: '15',\n comboId: 'a',\n },\n {\n id: '16',\n comboId: 'b',\n },\n {\n id: '17',\n comboId: 'b',\n },\n {\n id: '18',\n comboId: 'b',\n },\n {\n id: '19',\n comboId: 'b',\n },\n {\n id: '20',\n },\n {\n id: '21',\n },\n {\n id: '22',\n },\n {\n id: '23',\n comboId: 'c',\n },\n {\n id: '24',\n comboId: 'a',\n },\n {\n id: '25',\n },\n {\n id: '26',\n },\n {\n id: '27',\n comboId: 'c',\n },\n {\n id: '28',\n comboId: 'c',\n },\n {\n id: '29',\n comboId: 'c',\n },\n {\n id: '30',\n comboId: 'c',\n },\n {\n id: '31',\n comboId: 'c',\n },\n {\n id: '32',\n comboId: 'd',\n },\n {\n id: '33',\n comboId: 'd',\n },\n ],\n edges: [\n {\n source: 'a',\n target: 'b',\n label: 'Combo A - Combo B',\n size: 3,\n labelCfg: {\n autoRotate: true,\n style: {\n stroke: '#fff',\n lineWidth: 5,\n fontSize: 20,\n },\n },\n style: {\n stroke: 'red',\n },\n },\n {\n source: 'a',\n target: '33',\n label: 'Combo-Node',\n size: 3,\n labelCfg: {\n autoRotate: true,\n style: {\n stroke: '#fff',\n lineWidth: 5,\n fontSize: 20,\n },\n },\n style: {\n stroke: 'blue',\n },\n },\n {\n source: '0',\n target: '1',\n },\n {\n source: '0',\n target: '2',\n },\n {\n source: '0',\n target: '3',\n },\n {\n source: '0',\n target: '4',\n },\n {\n source: '0',\n target: '5',\n },\n {\n source: '0',\n target: '7',\n },\n {\n source: '0',\n target: '8',\n },\n {\n source: '0',\n target: '9',\n },\n {\n source: '0',\n target: '10',\n },\n {\n source: '0',\n target: '11',\n },\n {\n source: '0',\n target: '13',\n },\n {\n source: '0',\n target: '14',\n },\n {\n source: '0',\n target: '15',\n },\n {\n source: '0',\n target: '16',\n },\n {\n source: '2',\n target: '3',\n },\n {\n source: '4',\n target: '5',\n },\n {\n source: '4',\n target: '6',\n },\n {\n source: '5',\n target: '6',\n },\n {\n source: '7',\n target: '13',\n },\n {\n source: '8',\n target: '14',\n },\n {\n source: '9',\n target: '10',\n },\n {\n source: '10',\n target: '22',\n },\n {\n source: '10',\n target: '14',\n },\n {\n source: '10',\n target: '12',\n },\n {\n source: '10',\n target: '24',\n },\n {\n source: '10',\n target: '21',\n },\n {\n source: '10',\n target: '20',\n },\n {\n source: '11',\n target: '24',\n },\n {\n source: '11',\n target: '22',\n },\n {\n source: '11',\n target: '14',\n },\n {\n source: '12',\n target: '13',\n },\n {\n source: '16',\n target: '17',\n },\n {\n source: '16',\n target: '18',\n },\n {\n source: '16',\n target: '21',\n },\n {\n source: '16',\n target: '22',\n },\n {\n source: '17',\n target: '18',\n },\n {\n source: '17',\n target: '20',\n },\n {\n source: '18',\n target: '19',\n },\n {\n source: '19',\n target: '20',\n },\n {\n source: '19',\n target: '33',\n },\n {\n source: '19',\n target: '22',\n },\n {\n source: '19',\n target: '23',\n },\n {\n source: '20',\n target: '21',\n },\n {\n source: '21',\n target: '22',\n },\n {\n source: '22',\n target: '24',\n },\n {\n source: '22',\n target: '25',\n },\n {\n source: '22',\n target: '26',\n },\n {\n source: '22',\n target: '23',\n },\n {\n source: '22',\n target: '28',\n },\n {\n source: '22',\n target: '30',\n },\n {\n source: '22',\n target: '31',\n },\n {\n source: '22',\n target: '32',\n },\n {\n source: '22',\n target: '33',\n },\n {\n source: '23',\n target: '28',\n },\n {\n source: '23',\n target: '27',\n },\n {\n source: '23',\n target: '29',\n },\n {\n source: '23',\n target: '30',\n },\n {\n source: '23',\n target: '31',\n },\n {\n source: '23',\n target: '33',\n },\n {\n source: '32',\n target: '33',\n },\n ],\n combos: [\n {\n id: 'a',\n label: 'Combo A',\n },\n {\n id: 'b',\n label: 'Combo B',\n },\n {\n id: 'c',\n label: 'Combo D',\n },\n {\n id: 'd',\n label: 'Combo D',\n parentId: 'b',\n },\n ],\n};\n","pages/GeneralGraph/basicComboForce/index.acss":"/* required by usingComponents */","pages/GeneralGraph/basicComboForce/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/GeneralGraph/basicComboForce/index.js":"import F6 from '@antv/f6';\nimport { wrapContext } from '../../../utils/context';\nimport data from './data';\nimport comboforce from '@antv/f6/dist/extends/layout/comboForceLayout';\n/**\n * basicComboForce\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 // 注册布局\n F6.registerLayout('comboforce', comboforce);\n\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 * 初始化canvas回调,缓存获得的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\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: 50,\n minZoom: 0.00000001,\n layout: {\n type: 'comboforce',\n nodeSpacing: (d) => {\n if (d.id == '0') return 100;\n return 10;\n },\n },\n defaultNode: {\n size: 15,\n color: '#5B8FF9',\n style: {\n lineWidth: 2,\n fill: '#C6E5FF',\n },\n },\n defaultEdge: {\n size: 2,\n color: '#e2e2e2',\n },\n modes: {\n default: ['drag-combo', 'drag-node', 'drag-canvas', 'zoom-canvas'],\n },\n });\n\n this.graph.data(data);\n this.graph.render();\n this.graph.fitView();\n },\n});\n","pages/GeneralGraph/basicComboForce/index.json":"{\n \"defaultTitle\": \"basicComboForce\",\n \"usingComponents\": {\n \"f6-canvas\": \"@antv/f6-alipay/es/container/container\"\n }\n}\n","pages/GeneralGraph/basicComboForce/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":"e8891d40edfe9cc9d13d81ada6fa3f2c.json","size":710093,"url":"https://gw.alipayobjects.com/os/f6/9a8d9928-e603-4d01-8de3-f218b6df942f/demo_generalgraph_basiccomboforce/dist/herbox/e8891d40edfe9cc9d13d81ada6fa3f2c.json","ETag":"E8891D40EDFE9CC9D13D81ADA6FA3F2C","type":"json"}],"name":"pages/GeneralGraph/basicComboForce/index","buildVersion":"0.72.7","remaxVersion":"2.0.3","component2":false,"css2":false}