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 2021/11/21 21:56:09 UTC

[GitHub] [echarts] LeaVerou opened a new issue #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

LeaVerou opened a new issue #16087:
URL: https://github.com/apache/echarts/issues/16087


   ### What problem does this feature solve?
   
   Changing chart options and observing what happens is how most people learn how to use ECharts, at least in part.
   
   There is a bunch of demos on the echarts website that use random data. Here are a few examples:
   
   https://echarts.apache.org/examples/en/editor.html?c=calendar-simple
   https://echarts.apache.org/examples/en/editor.html?c=bar-brush
   https://echarts.apache.org/examples/en/editor.html?c=calendar-pie
   
   This means that every time the chart is redrawn, it's redrawn with entirely new data, which makes it hard to visually spot the differences the change produced, because *everything* is different. This bit me several times, where I was thrown because a tiny change in the chart option seemed to produce huge changes in the actual chart. 
   
   There is a very easy low-effort way to address this: Use a library to seed the random number generator, so that the generated data is the same on every run (unless the actual generation code changes of course — or the seed).
   There are even [libraries](https://github.com/davidbau/seedrandom) that allow you to seed `Math.random()` calls (instead of using a new method), so that the code changes would be minimal.
   
   See: 
   https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript
   https://stackoverflow.com/questions/424292/seedable-javascript-random-number-generator
   https://github.com/davidbau/seedrandom
   
   ### What does the proposed API look like?
   
   _(no API changes are needed)_
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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 #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

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


   @LeaVerou Thanks for the suggestion. We are using https://github.com/davidbau/seedrandom in our visual regression testing.  Indeed it will be helpful if we fixed the random data when doing live editing on the example page. Or at least a button to turn it on.


-- 
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] LeaVerou closed issue #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

Posted by GitBox <gi...@apache.org>.
LeaVerou closed issue #16087:
URL: https://github.com/apache/echarts/issues/16087


   


-- 
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 #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

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


   @LeaVerou Thanks for the suggestion. We are using https://github.com/davidbau/seedrandom in our visual regression testing.  Indeed it will be helpful if we fixed the random data when doing live editing in our examples. Or at least a button to turn it on.


-- 
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 #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

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


   Just updated the example page. It's using seeded random by default now. Also added a `Random` button on the preview panel that can change the random seed. Thanks again for this very useful suggestion


-- 
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] LeaVerou edited a comment on issue #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

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


   Wow, that was really fast, thank you! 😍
   I guess I’ll close this issue then.


-- 
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 #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

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


   Just updated the example page. It's using seeded random by default now. Also added a `Random` button on the preview panel that can change the random seed.


-- 
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 #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #16087:
URL: https://github.com/apache/echarts/issues/16087#issuecomment-974902762


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](https://echarts.apache.org/api.html) and [chart option](https://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/maillist.html).
   
   Have a nice day! 🍵


-- 
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] LeaVerou commented on issue #16087: Use seeded random numbers in demos so that the effect of changes is noticeable

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


   Wow, that was really fast! 😍


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