You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "yassilah (via GitHub)" <gi...@apache.org> on 2023/09/09 17:01:31 UTC

[GitHub] [echarts] yassilah opened a new pull request, #19099: Feat polar end angle

yassilah opened a new pull request, #19099:
URL: https://github.com/apache/echarts/pull/19099

   <!-- 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. -->
   
   Allow setting an `endAngle` alongside `startAngle` on a polar coordinate system.
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [x] This PR doesn't relate to document changes
   - [x] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] 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] harshsharma-11 commented on pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "harshsharma-11 (via GitHub)" <gi...@apache.org>.
harshsharma-11 commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1741659455

   hey @Ovilia i want to join slack channel of apache so how can i
   


-- 
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] Ovilia commented on pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1736590695

   @yassilah Thanks for this useful PR!


-- 
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] yassilah commented on pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "yassilah (via GitHub)" <gi...@apache.org>.
yassilah commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1713353914

   Link to a working example [here](https://echarts.apache.org/examples/en/editor.html?version=PR-19099%40589f66d&code=PYBwLglsB2AEC8sDeAoWsTADYEMBOAXLANpIC-ANMmQLoVqw7QDmWApgIIAeEAzkcQbpU6UbDABPEGyIByAMY4wbZsDwTZ9MegAmSnEQ548OCQDoAZnmABbABRJY7FmAAWRAKyxKsOwH0qCABKBAA-WAADAGIAEiQIWABqWABGMlgAYSUVNQkIoK1tXjB8MA4WdiIATgAGQrE2aB1y1hlYGqFveuRO9ElpOUVlVXVNXoxsfABJJrYuIhTu3X1DY1NLa3tHZ2Y3Ty7fANhgsMjY-KTU9Kzh3Pyl2GLSlsrYAFpah8bmira3lIAHB0xGQGHQGCYdBAAK68bh8ATkKiOTC4PAzHRzBbecHoXhsPAQNj8EidETaeTANRQ6DZADKEmKbBsclR-DG2lgehKqxM5istgcTkau3csC8PjsIXg4QAskpXJYsFS8HZ5W4zCYmoKQgAqVI1GpBArjfptWRYCDQNiyTqUMnjSnUq30xnKFmwWRsvAc7TejFY1IPbkGWBGPkbQXbEV7cUHKWndWKizKtRqhWapg6HWwfUpQ3Gh5muQAI3ZdrBKDIAG4gA)


-- 
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] github-actions[bot] commented on pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1713265033

   <!-- ECHARTS_PR_PREVIEW -->
   The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19099@589f66d
   <!-- ECHARTS_PR_PREVIEW -->


-- 
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] Ovilia merged pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia merged PR #19099:
URL: https://github.com/apache/echarts/pull/19099


-- 
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


Re: [PR] feat(polar): allow setting `angleAxis.endAngle` [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1921007934

   Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/apache/echarts-doc) for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the `PR: awaiting doc` label.


-- 
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 #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1736590490

   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


-- 
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 #19099: Feat polar end angle

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1712555235

   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).


-- 
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] yassilah commented on pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "yassilah (via GitHub)" <gi...@apache.org>.
yassilah commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1735318834

   Your suggestion indeed fixes the regression :)
   
   <img width="1303" alt="Capture d’écran 2023-09-26 à 13 06 52" src="https://github.com/apache/echarts/assets/13403295/9bdc54cd-a944-4cb5-a48b-8e3587f97d9a">
   


-- 
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] Ovilia commented on a diff in pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on code in PR #19099:
URL: https://github.com/apache/echarts/pull/19099#discussion_r1336770054


##########
src/component/axis/AngleAxisView.ts:
##########
@@ -138,18 +138,24 @@ const angelAxisElementsBuilders: Record<typeof elementList[number], AngleAxisEle
 
     axisLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
         const lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);
+        const angleAxis = polar.getAngleAxis();
+        const RADIAN = Math.PI / 180;
+        const angleExtent = angleAxis.getExtent();
 
         // extent id of the axis radius (r0 and r)
         const rId = getRadiusIdx(polar);
         const r0Id = rId ? 0 : 1;
-
         let shape;
+
         if (radiusExtent[r0Id] === 0) {
-            shape = new graphic.Circle({
+            shape = new graphic.Arc({

Review Comment:
   I run the visual tests (`npm run test:visual`) and find there are some subtle diffs with `polarLine.html`, which is a case when `startAngle` is not the default value. I would suggest using `graphic.Circle` when `Math.abs(angleExtent[1] - angleExtent[0]) === 360` (or is there any other situations?) and use `graphic.Arc` otherwise.



##########
src/component/axis/RadiusAxisView.ts:
##########
@@ -105,19 +105,26 @@ const axisElementBuilders: Record<typeof selfBuilderAttrs[number], AxisElementBu
         let lineColors = lineStyleModel.get('color');
         let lineCount = 0;
 
+        const angleAxis = polar.getAngleAxis();
+        const RADIAN = Math.PI / 180;
+        const angleExtent = angleAxis.getExtent();
+
         lineColors = lineColors instanceof Array ? lineColors : [lineColors];
 
         const splitLines: graphic.Circle[][] = [];
 
         for (let i = 0; i < ticksCoords.length; i++) {
             const colorIndex = (lineCount++) % lineColors.length;
             splitLines[colorIndex] = splitLines[colorIndex] || [];
-            splitLines[colorIndex].push(new graphic.Circle({
+            splitLines[colorIndex].push(new graphic.Arc({

Review Comment:
   Similar as above.



-- 
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] Ovilia commented on pull request #19099: feat(polar): allow setting `angleAxis.endAngle`

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #19099:
URL: https://github.com/apache/echarts/pull/19099#issuecomment-1735003490

   <img width="971" alt="image" src="https://github.com/apache/echarts/assets/779050/e56118c3-3235-4f35-9b92-839a188385be">
   
   The yellow areas in the right image shows the slight differences before and after this change.


-- 
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