You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "rajatagrawal (via GitHub)" <gi...@apache.org> on 2023/08/28 06:43:46 UTC

[GitHub] [echarts] rajatagrawal opened a new issue, #19046: [Feature] Add validity checker for ECharts options to public header

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

   ### What problem does this feature solve?
   
   We are working on an interactive chart builder using ECharts similar to https://echarts.apache.org/examples/en/editor.html?c=line-marker.
   
   Just like this example has an options validator, we would like to have a similar validator in our builder. It seems like that a validator like this is already present in ECharts SDK ecosystem. We would like to request exposing this validator as part of echarts API. This will help us to catch errors in chart configuration before rendering and show errors to the user proactively so that they can fix the errors.
   
   At the moment, the chart configuration may be incorrect and the chart doesn't display any data. The user doesn't have any visual feedback that the configuration is incorrect.
   
   ### What does the proposed API look like?
   
   We can have a function called validateOption on global echarts object that accepts options as an argument. It returns an object that contains boolean result true or false depending upon if the chart configuration options are valid or not.
   
   If the chart options are invalid, the function also returns a message property that contains the stack trace or details of error in the configuration and steps to fix it if possible.
   
   ```
   const { result, message } = echarts.validateOptions(options)
   
   result = false
   message = "dataSource is missing in configuration"
   ```
   


-- 
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] Ovilia commented on issue #19046: [Feature] Add validity checker for ECharts options to public header

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

   There is not such checker, I'm afraid. The above image is probably using `try-catch`.


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