DIAGRAM: ADia Javascript API
+-----------+ +-----------+ +---------+ +-----------------+
| HTML Page | | API User | | adia.js | | adia_worker.py |
+-----------+ +-----------+ +---------+ +-----------------+
| | | |
|~~~load()~~~~~~~~~~~~>| | |
| | | |
|<---------------------| | |
| | | |
|~~~load()~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>| |
| | | |
| | ************************************************
| | * while adia_worker is not loaded *
| | ************************************************
| | | |
| | |~~~isLoaded()~~~~~~~~~~~~~~~~~~>|
| | | |
| | |<--yes/no-----------------------|
| | | |
| | |~~~wait()~~~+ |
| | | | |
| | |<-----------+ |
| | | |
| | ************************************************
| | * end while *
| | ************************************************
| | | |
|<----------------------------------------| |
| | | |
| | ------------------------------------------------
| | | window.aDia.delay = 10 |
| | | window.aDia.oninit = (aDia) => ... |
| | | window.aDia.input = (aDia) => ... |
| | | window.aDia.onresult = (aDia, result) => ... |
| | ------------------------------------------------
| | | |
| |~~~configure()~~~>| |
| | | |
| |<-----------------| |
| | | |
| |~~~go()~~~~~~~~~~>| |
| | | |
| | ************************************************
| | * if source is changed *
| | ************************************************
| | | |
| | |~~~send(source)~~~~~~~~~~~~~~~~>|
| | | |
| | |<-------------------------------|
| | | |
| | ************************************************
| | * end if *
| | ************************************************
| | | |
| |<-----------------| |
| | | |
| | |<~~send(dia)~~~~~~~~~~~~~~~~~~~~|
| |<~~onresult()~~~~~| |
| | | |
| |----------------->| |
| | |------------------------------->|
| | | |
+-----------+ +-----------+ +---------+ +-----------------+
| HTML Page | | API User | | adia.js | | adia_worker.py |
+-----------+ +-----------+ +---------+ +-----------------+