antvis/G6

4.8.10版本 使用comboCombined布局,设置outerLayout和innerLayout是使用了new G6.Layout(){}后报web worker错误,无法展示拓扑 #4622

lastsong0328 posted onGitHub

Describe the bug

4.8.10版本 使用comboCombined布局,设置outerLayout和innerLayout是使用了new G6.Layout(){}后报web worker错误,无法展示拓扑

layout failed DOMException: Failed to execute 'postMessage' on 'Worker': function () {} could not be cloned. at LayoutController.runWebworker (http://localhost:62206/vendor.js:49161:14) at http://localhost:62206/vendor.js:49116:22 at _ZoneDelegate.invoke (http://localhost:62206/polyfills.js:7568:158) at Object.onInvoke (http://localhost:62206/vendor.js:210596:25) at _ZoneDelegate.invoke (http://localhost:62206/polyfills.js:7568:46) at Zone.run (http://localhost:62206/polyfills.js:7351:35) at http://localhost:62206/polyfills.js:8429:28 at _ZoneDelegate.invokeTask (http://localhost:62206/polyfills.js:7595:171) at http://localhost:62206/vendor.js:210283:49 at AsyncStackTaggingZoneSpec.onInvokeTask (http://localhost:62206/vendor.js:210283:30)

Your Example Website or App

na

Steps to Reproduce the Bug or Issue

na

Expected behavior

na

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response


g6升级到4.8.15,问题依旧存在

posted by lastsong0328 almost 2 years ago

具体的配置发一下看看

posted by Yanyan-Wang almost 2 years ago
  Force:{
    type: 'comboCombined',
    center:[0,0],
    nodeSize: [40,20], //30?
    preventOverlap: true,
    spacing: 20,
    //comboSpacing: 50,
    //comboPadding:[20, 50, 35, 50],
    /*
    outerLayout: new G6.Layout['force2']({
      factor: 5,// 默认是 2
      linkDistance: 200,
      preventOverlap: true,
      nodeSpacing:100
    }),

    onLayoutEnd: () => {      // 可选
      console.log('combo force layout done');
    },

    outerLayout: new G6.Layout['dagre']({
     type: 'dagre',
     rankdir: 'BT',
     nodeSize: [40, 20],
     nodesep: 100,
     ranksep: 80,
     nodeDimensionsIncludeLabels: true,
     ranker: 'tight-tree',
     fit: true,
     sortByCombo: true,
    }),
    innerLayout: new G6.Layout['dagre']({
      type: 'dagre',
      rankdir: 'BT',
      nodeSize: [40, 20],
      nodesep: 60,
      ranksep: 20,
      fit: true,
      ranker: 'tight-tree',
      sortByCombo:true,
    }),*/
  },
posted by lastsong0328 almost 2 years ago

outerLayout或者innerLayout如果放开,就会出现上面提到的web worker的报错。目前是4.8.10,升级到4.8.15也有此问题

posted by lastsong0328 almost 2 years ago

没能复现:https://codesandbox.io/s/zealous-andras-vdcqsh?file=/index.js

你可以 fork 这个 demo,复现一下你的问题

posted by Yanyan-Wang almost 2 years ago

没能复现:https://codesandbox.io/s/zealous-andras-vdcqsh?file=/index.js

你可以 fork 这个 demo,复现一下你的问题

如果配置了workerEnabled:true会出现这个web worker的错误,有什么办法可以解决

posted by chiyu1996 over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests