Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Donut的Out of Memory问题 #1245

Closed
glfeng318 opened this issue Jul 1, 2020 · 2 comments · Fixed by #1321
Closed

Donut的Out of Memory问题 #1245

glfeng318 opened this issue Jul 1, 2020 · 2 comments · Fixed by #1321
Assignees
Labels
Milestone

Comments

@glfeng318
Copy link
Contributor

环形图的angleField和colorField如果搞反,比如分类字段名传给angleField然后数值字段名传给colorField,
会直接引发浏览器Out of Memory.
可能不算bug但做一下检查或者避免一下会不会好点?

import { Donut } from '@antv/g2plot';

const data = [
  {
    type: '分类一',
    value: 27,
  },
  {
    type: '分类二',
    value: 25,
  },
  {
    type: '分类三',
    value: 18,
  },
  {
    type: '分类四',
    value: 15,
  },
  {
    type: '分类五',
    value: 10,
  },
  {
    type: '其它',
    value: 5,
  },
];

const donutPlot = new Donut(document.getElementById('container'), {
  forceFit: true,
  title: {
    visible: true,
    text: '环图',
  },
  description: {
    visible: true,
    text: '环图的外半径决定环图的大小,而内半径决定环图的厚度。',
  },
  radius: 0.8,
  padding: 'auto',
  data,
  angleField: 'type',
  colorField: 'value',
});

donutPlot.render();

@hustcc
Copy link
Member

hustcc commented Jul 15, 2020

感谢反馈。我们会在 v2 中加入这个 case。

@hustcc hustcc added this to the v2 milestone Jul 15, 2020
@hustcc hustcc added the v2 label Jul 15, 2020
@visiky visiky linked a pull request Jul 22, 2020 that will close this issue
1 task
@visiky
Copy link
Member

visiky commented Jul 22, 2020

v2 单测已加上这个case,后续会避免触发该现象

@visiky visiky closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants