You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "sirAbramstone (via GitHub)" <gi...@apache.org> on 2023/02/12 14:49:00 UTC

[GitHub] [echarts] sirAbramstone opened a new pull request, #18259: feat(tooltip): support relative length units for font-size. close #18253

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

   <!-- 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?
   
   Supports relative length units in the `tooltip` component option `textStyle.fontSize`, when the tooltip option `renderMode` is equal 'html'.
   
   
   ### Fixed issues
   
   [#18253](https://github.com/apache/echarts/issues/18253)
   
   
   ## Details
   
   ### Before: What was the problem?
   
   Functions that resolve the font-size append 'px' string to any given value.
   
   ![image](https://user-images.githubusercontent.com/30146267/218317643-3a875d96-7e50-4958-8e81-12c1f4cf5494.png)
   
   
   
   ### After: How does it behave after the fixing?
   
   `Tooltip` supports all known units and is displayed correctly.
    
   ![image](https://user-images.githubusercontent.com/30146267/218317853-d17be776-4068-441e-b7fe-62c1800d70f7.png)
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] 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
   
   `tooltip-textStyle-fontSize.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] Ovilia commented on pull request #18259: feat(tooltip): support relative length units for font-size. close #18253

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

   @sirAbramstone Yes, it's not using zrender. But if we are going to support units other than `px`, then it should also support these units for other options besides tooltip. Otherwise, the developers may get confused why some options support `rem` while some not. So it should be implemented in zrender and you have to make sure whenever `px` is supported, other units are also supported. For example, all options about `fontSize`.


-- 
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] sirAbramstone commented on pull request #18259: feat(tooltip): support relative length units for font-size. close #18253

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

   > I think this should be implemented in [zrender src/graphic/Text.ts](https://github.com/ecomfe/zrender/blob/9197e0573daaedb2344a69acc83b4dd03d070615/src/graphic/Text.ts#L917). The test case should be added at [Text.test.ts](https://github.com/ecomfe/zrender/blob/9197e0573daaedb2344a69acc83b4dd03d070615/test/ut/spec/graphic/Text.test.ts).
   
   Hi, Ovilia! As I understood, the method `parseFontSize` that you attached is only used for the tooltip if its `renderMode` is equal to 'richText' (and in this case relative units no longer had any problems with support). When `renderMode` is 'html', the font-string is built using the methods I fixed and has nothing to do with zrender lib. Correct me if I'm wrong.


-- 
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 #18259: feat(tooltip): support relative length units for font-size. close #18253

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

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