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/02/15 17:00:51 UTC

[GitHub] [echarts] Raphyyy opened a new issue #16514: [Bug] "DEPRECATED: "api.style" has been deprecated"

Raphyyy opened a new issue #16514:
URL: https://github.com/apache/echarts/issues/16514


   ### Version
   
   5.2.2
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap
   
   ### Steps to Reproduce
   
   1. Open https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap
   
   ### Current Behavior
   
   An option from the doc is deprecated
   
   ### Expected Behavior
   
   The options from the docs shouldn't be deprecated
   
   ### Environment
   
   ```markdown
   - OS: Windows
   - Browser: Chrome
   - Framework: /
   ```
   
   
   ### Any additional comments?
   
   I am using this echarts from example in my app : https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap
   However, I have this warn in the console : `styleCompat.js:238 [ECharts] DEPRECATED: "api.style" has been deprecated. Please write literal style directly instead.`
   I tried to find more about it and I could only find a bit of info in the Echarts changelog `In renderItem, the api.style(...) and api.styleEmphasis(...) are deprecated. Because it is not really necessary and hard to ensure backward compatibility. Users can fetch system designated visual by api.visual(...).`
   Though, I couldn't find more and the doc still make the use of `api.style()` : https://echarts.apache.org/en/option.html#series-custom.renderItem.return
   
   What should I change in the example above to make it works without deprecacted options ?


-- 
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 issue #16514: [Bug] "DEPRECATED: "api.style" has been deprecated"

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #16514:
URL: https://github.com/apache/echarts/issues/16514#issuecomment-1041032731


   Yes the example can be changed to simpler:
   ```ts
   style: {
     fill: api.visual('color')
   }
   ```


-- 
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] Raphyyy commented on issue #16514: [Bug] "DEPRECATED: "api.style" has been deprecated"

Posted by GitBox <gi...@apache.org>.
Raphyyy commented on issue #16514:
URL: https://github.com/apache/echarts/issues/16514#issuecomment-1042094432


   Thanks @pissang 
   I let you close this, as I don't know if the documentation / examples should be updated


-- 
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 edited a comment on issue #16514: [Bug] "DEPRECATED: "api.style" has been deprecated"

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16514:
URL: https://github.com/apache/echarts/issues/16514#issuecomment-1041032731


   Yes the example can be changed to simpler:
   ```ts
   return {
     ...
     style: {
       fill: api.visual('color')
     }
   }
   ```


-- 
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] htr3n commented on issue #16514: [Bug] "DEPRECATED: "api.style" has been deprecated"

Posted by GitBox <gi...@apache.org>.
htr3n commented on issue #16514:
URL: https://github.com/apache/echarts/issues/16514#issuecomment-1056122575


   @pissang I got a similar use case with custom render using `api.style()`. It seems that `api.style()` does more than just setting the styles.
   
   ```javascript
   const customRender = (params, api) => {
       const start = api.coord([api.value(0), 1]);
       const style = api.style();
   
       return {
           type: 'rect',
           shape: {
               x: start[0],
               y: start[1],
               width: params.coordSys.width / values.length,
               height: params.coordSys.height
           },
           style: style
       };
   };
   ```
   
   When I print out the result of `api.style()` , it's more than just styling. There are setting of the Y value, right?
   
   ```json
   {
       "fill": "white",
       "stroke": "black",
       "textPosition": "inside",
       "textDistance": 5,
       "textFill": "black",
       "fontStyle": "normal",
       "fontWeight": "normal",
       "fontSize": 12,
       "fontFamily": "sans-serif",
       "text": "YEF",
       "legacy": true
   }
   ```


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