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 2023/01/20 13:02:37 UTC

[GitHub] [echarts] infacto opened a new issue, #18199: [Improvement] Canvas willReadFrequently warning.

infacto opened a new issue, #18199:
URL: https://github.com/apache/echarts/issues/18199

   ### What problem does this feature solve?
   
   No bug, no feature. Just something I see on console (Chrome 109):
   
   > Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
   
   ### What does the proposed API look like?
   
   I have no idea. I just wanted to report this. Maybe we find a solution?


-- 
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.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: [I] [Improvement] Canvas willReadFrequently warning. [echarts]

Posted by "learntimes (via GitHub)" <gi...@apache.org>.
learntimes commented on issue #18199:
URL: https://github.com/apache/echarts/issues/18199#issuecomment-2065613418

   // Temporarily override getContext method to set willReadFrequently
   // Use this method with caution to ensure it does not interfere with other parts of your application.
   const originalGetContext = HTMLCanvasElement.prototype.getContext
   HTMLCanvasElement.prototype.getContext = function (type, attributes) {
     if (type === '2d') {
       attributes = { ...attributes, willReadFrequently: true }
     }
     return originalGetContext.call(this, type, attributes)
   }
   
   mChart = echarts.init(target.value)
   
   // Restore the getContext method after initialization to avoid affecting other canvas elements on the page.
   // Use setTimeout to ensure that ECharts initialization has completed
   setTimeout(() => {
     HTMLCanvasElement.prototype.getContext = originalGetContext
   }, 1000) // Restore after a delay of 1000 milliseconds, adjust based on actual situation


-- 
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: [I] [Improvement] Canvas willReadFrequently warning. [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #18199:
URL: https://github.com/apache/echarts/issues/18199#issuecomment-4919367371

   This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!


-- 
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: [I] [Improvement] Canvas willReadFrequently warning. [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #18199:
URL: https://github.com/apache/echarts/issues/18199#issuecomment-4848104793

   This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.


-- 
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 issue #18199: [Improvement] Canvas willReadFrequently warning.

Posted by echarts-bot.
echarts-bot[bot] commented on issue #18199:
URL: https://github.com/apache/echarts/issues/18199#issuecomment-1411615786

   @infacto Please provide a demo for the issue either with [Official Editor](https://echarts.apache.org/examples/editor.html), [CodePen](https://codepen.io/Ovilia/pen/dyYWXWM), [CodeSandbox](https://codesandbox.io/s/echarts-basic-example-template-mpfz1s) or [JSFiddle](https://jsfiddle.net/plainheart/e46ozpqj/7/).


-- 
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: [I] [Improvement] Canvas willReadFrequently warning. [echarts]

Posted by "learntimes (via GitHub)" <gi...@apache.org>.
learntimes commented on issue #18199:
URL: https://github.com/apache/echarts/issues/18199#issuecomment-2065618226

   The answer above was provided by AI,
   
   The issue has been around for a long time, perhaps echarts should provide a property to set willReadFrequently, just like this: 
   
   mChart = echarts.init(target.value, null, {
       renderer: 'canvas',
       willReadFrequently: 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


Re: [I] [Improvement] Canvas willReadFrequently warning. [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #18199: [Improvement] Canvas willReadFrequently warning.
URL: https://github.com/apache/echarts/issues/18199


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