You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "lukeatkins (via GitHub)" <gi...@apache.org> on 2023/05/29 04:32:10 UTC

[GitHub] [echarts] lukeatkins opened a new issue, #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings

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

   ### What problem does this feature solve?
   
   Example: I have a page with lots of charts and a tab-like interface.
   Content on the inactive tabs in invisible (display: none), so any charts on that tab will have no width or height.
   When I change tabs I call the resize() function on all charts.
   This warning floods the console log.
   
   ### What does the proposed API look like?
   
   Perhaps an extra option in the echarts init function called "suppressDOMSizeWarnings"
   
   ```
   echarts.init(dom: HTMLDivElement|HTMLCanvasElement, theme?: Object|string, opts?: {
       suppressDOMSizeWarnings?: boolean, //true to disable "Can't get DOM width or height" warnings
       devicePixelRatio?: number,
       renderer?: string,
       useDirtyRect?: boolean,     // Since `5.0.0`
       useCoarsePointer?: boolean, // Since `5.4.0`
       pointerSize?: number,       // Since `5.4.0`
       ssr?: boolean,              // Since `5.3.0`
       width?: number|string,
       height?: number|string,
       locale?: string             // Since `5.0.0`
   }) => ECharts
   ```


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


[GitHub] [echarts] plainheart commented on issue #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings

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

   This warning won't output in the production environment. It's not necessary to add a new option. So I'm going to close 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] plainheart closed issue #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart closed issue #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings
URL: https://github.com/apache/echarts/issues/18677


-- 
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] helgasoft commented on issue #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings

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

   > Content on the inactive tabs in invisible (display: none), so any charts on that tab will have no width or height.
   When I change tabs I call the resize() function on all charts.
   
   Cannot quite understand, usually in a tabset, just one tab is visible by default. If so, why have style _display: none_ on the others?
   Also why is resizing necessary on tab change ?  
   **Sample code** would help clarify your feature 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] lukeatkins commented on issue #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings

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

   > > Content on the inactive tabs in invisible (display: none), so any charts on that tab will have no width or height.
   > > When I change tabs I call the resize() function on all charts.
   > 
   > Cannot quite understand, usually in a tabset, just one tab is visible by default. If so, why have style _display: none_ on the others? Also why is resizing necessary on tab change ? **Sample code** would help clarify your feature request.
   
   Sorry, I mean tabs on the page, not browser tabs. For example: https://www.w3schools.com/howto/howto_js_tabs.asp
   All inactive tabs have display: none. When switching tabs the charts sometimes don't fill the space properly, so it's easy just to call resize() all all charts.
   
   > This log only happen in develop eniroment. When using `echarts.min.js`, there won't be this message in the console.
   Thanks for the tip.
   


-- 
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 issue #18677: [Feature] Option to suppress "Can't get DOM width or height" warnings

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

   This log only happen in develop eniroment. When using `echarts.min.js`, there won't be this message in the console.


-- 
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] [Feature] Option to suppress "Can't get DOM width or height" warnings [echarts]

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

   Maybe you could try to set 'auto' for the height and width when init the chart.
    let chart = echarts.init(dom,null,{
             width: 'auto', 
             height:'auto'
     });


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