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

feat(sankey): support null to represent loss. #3222

Merged
merged 2 commits into from
May 24, 2022
Merged

feat(sankey): support null to represent loss. #3222

merged 2 commits into from
May 24, 2022

Conversation

visiky
Copy link
Member

@visiky visiky commented May 24, 2022

PR includes

  • fixed #0
  • add / modify test cases
  • documents, demos

Screenshot

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

const DATA = [
  { source: '首次打开', target: '首页 UV', value: 160 },
  { source: '结果页', target: '首页 UV', value: 40 },
  { source: '验证页', target: '首页 UV', value: 10 },
  { source: '我的', target: '首页 UV', value: 10 },
  { source: '朋友', target: '首页 UV', value: 8 },
  { source: null, target: '首页 UV', value: 27 },
  { source: '首页 UV', target: '理财', value: 30 },
  { source: '首页 UV', target: '扫一扫', value: 40 },
  { source: '首页 UV', target: '服务', value: 35 },
  { source: '首页 UV', target: '蚂蚁森林', value: 25 },
  { source: '首页 UV', target: '跳失', value: 10 },
  { source: '首页 UV', target: '借呗', value: 30 },
  { source: '首页 UV', target: '花呗', value: 40 },
  { source: '首页 UV', target: null, value: 45 },
];

const sankey = new Sankey('container', {
  data: DATA,
  sourceField: 'source',
  targetField: 'target',
  weightField: 'value',
  nodeWidthRatio: 0.008,
  nodePaddingRatio: 0.03,
});

sankey.render();
Before After
image image

@github-actions github-actions bot added the feature 特性需求 label May 24, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 24, 2022

🎊 PR Preview 318ae4c has been successfully built and deployed to https://antvis-G2Plot-preview-pr-3222.surge.sh?type=diff&date=2022-05-24

🕐 Build time: 63.783s

🤖 By Surge Ui Insight

@hustcc hustcc self-requested a review May 24, 2022 06:58
@visiky visiky merged commit 65277bd into master May 24, 2022
@visiky visiky deleted the feat/sankey branch May 24, 2022 07:53
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 this pull request may close these issues.

2 participants