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(module: graph): support graph component #6053

Merged
merged 5 commits into from
Nov 21, 2020

Conversation

simplejason
Copy link
Member

@simplejason simplejason commented Nov 15, 2020

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@zorro-bot
Copy link

zorro-bot bot commented Nov 15, 2020

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Nov 15, 2020

Codecov Report

Merging #6053 (a71a740) into master (b067e7e) will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6053      +/-   ##
==========================================
- Coverage   89.95%   89.83%   -0.12%     
==========================================
  Files         465      465              
  Lines       14046    14078      +32     
  Branches     2308     2235      -73     
==========================================
+ Hits        12635    12647      +12     
- Misses        863      880      +17     
- Partials      548      551       +3     
Impacted Files Coverage Δ
components/tree-select/tree-select.component.ts 90.13% <0.00%> (-3.43%) ⬇️
components/tabs/tab-nav-bar.component.ts 80.91% <0.00%> (-0.71%) ⬇️
components/tooltip/base.ts 91.41% <0.00%> (-0.09%) ⬇️
components/tabs/tabset.component.ts 86.20% <0.00%> (ø)
components/select/option-item.component.ts 92.59% <0.00%> (ø)
components/typography/typography.component.ts 97.82% <0.00%> (+0.03%) ⬆️
components/select/select.component.ts 87.70% <0.00%> (+0.16%) ⬆️
components/select/select-top-control.component.ts 89.28% <0.00%> (+0.39%) ⬆️
components/code-editor/code-editor.component.ts 14.78% <0.00%> (+1.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b067e7e...a71a740. Read the comment docs.

feat(module: graph): init graph

feat(module: graph): fix package.json

fix(module: graph): fix some definitions

fix(module: graph): extend interfaces

fix(module: graph): improve autofit size

fix(module: graph): fix padding of sub graph, it still has bug

fix(module: graph): change package and demo

fix(module: graph): allow toggle node by icon

fix(module: graph): fix center position

fix(module: graph): add minimap

fix(module: graph): use d3-* instead of d3 and improve docs

fix(module: graph): remove download function

fix(module: graph): fix interface and render bugs

fix(module: graph): support arrow element

fix(module: graph): rename layout method

fix(module: graph): refactor apis and inputs

fix(module: graph): support custom node template
@simplejason simplejason changed the title WIP feat(module: graph): support graph component feat(module: graph): support graph component Nov 21, 2020
components/graph/core/minimap.ts Show resolved Hide resolved
components/graph/data-source/base-graph-source.ts Outdated Show resolved Hide resolved
components/graph/data-source/graph-data-source.ts Outdated Show resolved Hide resolved

export class NzGraphData implements NzGraphBaseSource<NzGraphDataDef, string> {
_data = new BehaviorSubject<NzGraphDataDef>({} as NzGraphDataDef);
dataSource!: NzGraphDataDef;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constructor 构造参数是可选的,这里类型不安全

this.cdr.detectChanges();
});
} else {
throw Error(`A valid data source must be provided.`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

既然已经在 ngAfterContentChecked 中检查了,这里为什么还要抛错

components/graph/graph.component.ts Outdated Show resolved Hide resolved
export const NZ_GRAPH_LAYOUT_SETTING: NzLayoutSetting = {
animation: {
/** Default duration for graph animations in ms. */
duration: 250
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

animatonBuilder 中没有使用这块配置

components/graph/doc/index.en-US.md Outdated Show resolved Hide resolved
const height = contentEle.getBoundingClientRect().height;
const width = contentEle.getBoundingClientRect().width;
// Element id type is string
const targetNode = flattenNodes(renderInfo).find(n => `${n.name}` === nodeEle.id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 deepFind, flattenNodes 每次都是全量循环

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

部分暂时不改了,下个版本一起做掉,这个rc版本先内部试用

@hsuanxyz hsuanxyz mentioned this pull request Nov 21, 2020
8 tasks
@hsuanxyz hsuanxyz merged commit e69303f into NG-ZORRO:master Nov 21, 2020
@pr-triage pr-triage bot added the PR: merged label Nov 21, 2020
@simplejason simplejason deleted the nz-graph branch November 23, 2021 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants