The Yi Jing meets Open Source
Chinese civilization draws on the wisdom of a 3000 year old book to guide political, business & social relationships. We should understand & learn from it.
If I asked you to name the most famous book in Chinese history, what would you say? Chances are, you might think of something like ‘The Art of War’ by Sun Tzu. Outside of Confucius, Jack Ma & current President Xi Jinping, you might not know of many other influential Chinese writers, thinkers or leaders. The fact is, Chinese civilization stretches back 5000 years, with a standardized Imperial writing system as far back as 3500 years ago in the Shang Dynasty. It is hard to give the title ‘most famous’ to any one book, so perhaps we should focus on the Oldest of the 5 Chinese Classics - the Yi Jing (易經) (I-Ching) known as the Book of Changes.
One can describe the Yi Jing as a predictive system for reality. Not really a book, it is a divination manual - an ‘Oracle’, that will answer the questions you put to it by performing a complex ritual 6 times to build a hexagram. The ritual involves taking a bundle of 50 sticks of yarrow, sorting them in a very specific way, and receiving one of 4 results to draw one of the lines necessary for the Hexagram. Each of the 64 hexagrams has it’s own meaning, and serves as the answer to your question. Sometimes the answers are clear, other times less so. Confucius himself wrote commentaries on each of the 64 outcomes, and many answers are open to interpretation.
The Yi Jing remains relevant today as business and political leaders continue to consult the Yi Jing in order to gain clarity on the challenges they face carrying out their work. For many in China, it is a part of their folk religion - a blend of Confucian, Daoist, Buddhist & local beliefs influential in a particular city or county. For some, it is an immensely useful tool that is frequently consulted when facing a situation of great uncertainty. And for many people in China & East Asia generally, they may not know it exists at all.
I wanted to take a short break from a project I’m working on, and decided to take a week off to prototype the Yi Jing and start an open-source project. It is deployed here, for your pleasure. My hope is to help create an accessible way for people to learn more about the rich, ancient wisdom of Chinese civilization & gain a more nuanced insight into Chinese perspectives on managing relationships and society.
I’ve made the initial contributions to the codebase over the course of a week, with a prototype I believe the community can be proud of. You can ask a question to the Oracle, wait a period of 8 minutes and 8 seconds as you contemplate the question you have asked, and receive an algorithmically correct judgement. You can review the commentary of all 64 hexagrams at any time, and (as a bonus) read the Tao te Ching by Lao Tzu.
There are many things that can be done to improve the authenticity and user experience, and I welcome ideas, suggestions & pull-requests from the open-source community. Especially pull-requests. Some of the major items I think could be helpful:
Adding a ‘records’ or ‘journal’ feature, where we can store previously asked questions and their judgements. This should be done on localStorage, and easily deleted. The questions a reader asks may be sensitive, and should not be stored in a database somewhere.
Improve the reader experience of the Tao te Ching - storing a bookmark of where one left off, perhaps considering a better translation.
Add Progressive Web Application functionality, ensuring a fully offline experience after the first download. This shouldn’t take long - the key here is adding more responsive CSS code, as the prototype was developed for mobile and lacks any real desktop styling.
Debate which version of the Yi Jing translation should serve as the ‘default’ text. As the Book of Change’s name implies, no book has seen more edits, changes, restorations and commentaries than it has. There are many translations & interpretations available. Perhaps we can have a system setting to set the ‘default’ translation, to enable choice. I’ve collected the initial data into a massive TS/JS object, and we can think about how we store additional translations/commentaries.
Better animations, creating a smoother & more intimate experience. Perhaps some optional background instrumentation.
You can access the Oracle here, and can click/tap/clap/tick the ‘Source Code’ button to view the TypeScript & React code on GitHub. Fork the repository, or open an issue on the main page to start the conversation.
I will be posting an additional article, breaking down the process from ideation to deployment where I will give additional acknowledgements to the open-source heroes who provided some of the foundational pieces that were integrated. I would like to thank Brian Fitzgerald of the Netherlands for his open-source JQuery Yarrow algorithm, Ashley Blewer for her open-source JQuery implementation that I borrowed some JSON from, Michael Guerrero (I believe this is him) for some JSON from your CodePen that I used for the Tao te Ching experience. I would like to thank Anneke Vanden Heuvel of the Netherlands for her Drupal I-Ching Journal source code. I used your lovingly compressed images representing the hexagrams, and scraped your commentary .txt files and turned them into JSON! I would like to thank Jason White for the source code of his NPM package i-ching, from which I got some valuable JSON. The common theme is that I’m a fiend for some JSON! We now have a semi-definitive JSON object with all the Yi Jing data we need, including names, symbols, judgements, some commentary (we may or may not replace) and more. This was a group effort, and a culmination of all the work done in this space so far.
If you are interested in contributing towards this project, head over to the source code and open an issue or send a PR!