You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/03/29 15:19:57 UTC
[GitHub] [echarts] susiwen8 opened a new pull request #16767: feat(sankey): `sankey` support `edgeLabel`
susiwen8 opened a new pull request #16767:
URL: https://github.com/apache/echarts/pull/16767
<!-- Please fill in the following information to help us review your PR more efficiently. -->
## Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [x] new feature
- [ ] others
### What does this PR do?
<!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
### Fixed issues
- Close #7233
## Details
### Before: What was the problem?
`Sankey` don't have label on edges
<img width="723" alt="Screen Shot 2022-03-29 at 11 18 24 PM" src="https://user-images.githubusercontent.com/20318608/160645994-b2919995-bd4d-43f0-99b5-cb4ae604b8ea.png">
### After: How is it fixed in this PR?
<img width="1203" alt="Screen Shot 2022-03-29 at 11 18 36 PM" src="https://user-images.githubusercontent.com/20318608/160646085-99dc03d1-0436-4f48-b5cf-b9b991a11640.png">
## Misc
<!-- ADD RELATED ISSUE ID WHEN APPLICABLE -->
- [ ] The API has been changed (apache/echarts-doc#xxx).
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
### Related test cases or examples to use the new APIs
test/sankey-depth.html
## Others
### Merging options
- [x] Please squash the commits into a single one when merging.
### Other information
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] echarts-bot[bot] commented on pull request #16767: feat(sankey): `sankey` support `edgeLabel`
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #16767:
URL: https://github.com/apache/echarts/pull/16767#issuecomment-1082006673
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
The pull request is marked to be `PR: author is committer` because you are a committer of this project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] pissang commented on a change in pull request #16767: feat(sankey): `sankey` support `edgeLabel`
Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #16767:
URL: https://github.com/apache/echarts/pull/16767#discussion_r838093092
##########
File path: src/chart/sankey/SankeyView.ts
##########
@@ -193,7 +193,9 @@ class SankeyView extends ChartView {
cpy2: cpy2
});
- curve.useStyle(lineStyleModel.getItemStyle());
+ const style = lineStyleModel.getItemStyle();
+ curve.useStyle(style);
+ edgeData.setItemVisual(idx, 'style', style);
Review comment:
It's better to put visual logic in `sankeyVisual.ts`
##########
File path: src/chart/sankey/SankeyView.ts
##########
@@ -220,6 +222,15 @@ class SankeyView extends ChartView {
}
}
+ setLabelStyle(
+ curve, getLabelStatesModels(edgeModel, 'edgeLabel'),
+ {
+ labelFetcher: seriesModel,
+ labelDataIndex: edge.dataIndex,
+ defaultText: `${edgeModel.get('value')}`
Review comment:
template string is unnecessary here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] susiwen8 commented on a change in pull request #16767: feat(sankey): `sankey` support `edgeLabel`
Posted by GitBox <gi...@apache.org>.
susiwen8 commented on a change in pull request #16767:
URL: https://github.com/apache/echarts/pull/16767#discussion_r838493222
##########
File path: src/chart/sankey/SankeyView.ts
##########
@@ -220,6 +222,15 @@ class SankeyView extends ChartView {
}
}
+ setLabelStyle(
+ curve, getLabelStatesModels(edgeModel, 'edgeLabel'),
+ {
+ labelFetcher: seriesModel,
+ labelDataIndex: edge.dataIndex,
+ defaultText: `${edgeModel.get('value')}`
Review comment:
`get` function returns a `number`, but `defaultText` is a `string`, using template to get rid of ts error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org