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 2021/03/15 08:25:00 UTC

[GitHub] [echarts] 100pah opened a new pull request #14473: feature: [tooltip] correct component tooltip cascade and support manually trigger component tooltip.

100pah opened a new pull request #14473:
URL: https://github.com/apache/echarts/pull/14473


   
   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [x] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   ## Details
   
   
   + Make component tooltip inherit cascade correct: itemOption.tooltip -> componentOption.tooltip -> globalOption.tooltip
   (previous incorrect cascade: itemOption.tooltip -> globalOption.tooltip
   + Enable trigger component tooltip by 
   ```js
   chart.dispatchAction({ 
       type: 'showTip', 
       toolboxIndex: 0, 
       name: 'someTootboxItemName' 
   });
   // or 
   chart.dispatchAction({ 
       type: 'showTip', 
       legendId: 'legend_id', 
       name: 'someLegendItemName' 
   });
   ```
   
   To make (2) happen, this commit migrate `ECElement['tooltip']` to ECData['tooltipConfig']['option'],
   and add other info in ECData['tooltipConfig']:
   ```ts
   interface ECData {
       // ...
       tooltipConfig?: {
           // Used to find component tooltip option, which is used as
           // the parent of tooltipConfig.option for cascading.
           // If not provided, do not use component as its parent.
           // (Set manatary to make developers not to forget them).
           componentMainType: ComponentMainType;
           componentIndex: number;
           // Target item name to locate tooltip.
           name: string;
           option: ComponentItemTooltipOption<unknown>;
       };
   }
   ```
   to locate a tooltipable component element by a payload.
   
   ## Test case
   
   `test/tooltip-component.html`
   


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

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] 100pah merged pull request #14473: feature: [tooltip] correct component tooltip cascade and support manually trigger component tooltip.

Posted by GitBox <gi...@apache.org>.
100pah merged pull request #14473:
URL: https://github.com/apache/echarts/pull/14473


   


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

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 #14473: feature: [tooltip] correct component tooltip cascade and support manually trigger component tooltip.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14473:
URL: https://github.com/apache/echarts/pull/14473#issuecomment-799218449


   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.

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 #14473: feature: [tooltip] correct component tooltip cascade and support manually trigger component tooltip.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14473:
URL: https://github.com/apache/echarts/pull/14473#issuecomment-800804996


   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.

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 #14473: feature: [tooltip] correct component tooltip cascade and support manually trigger component tooltip.

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #14473:
URL: https://github.com/apache/echarts/pull/14473#discussion_r594830532



##########
File path: src/component/graphic/install.ts
##########
@@ -514,6 +519,25 @@ class GraphicComponentView extends ComponentView {
                 elInner.__ecGraphicWidthOption = (elOption as GraphicComponentGroupOption).width;
                 elInner.__ecGraphicHeightOption = (elOption as GraphicComponentGroupOption).height;
                 setEventData(el, graphicModel, elOption);
+
+                const tooltipOption = elOption.tooltip;

Review comment:
       I remember tooltip property can be a string previously




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

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