Add extension usage instruction
This commit is contained in:
Родитель
4c03bf020c
Коммит
c14219c64c
13
README.md
13
README.md
|
@ -38,11 +38,22 @@ const sampleCircuit = {
|
|||
2. Draw it in a `div`:
|
||||
```js
|
||||
const sampleDiv = document.getElementById('sample');
|
||||
qviz.draw(sampleCircuit, sampleDiv, qviz.STYLES['Default']);
|
||||
qviz.create(sampleCircuit)
|
||||
.draw(sampleDiv)
|
||||
```
|
||||
|
||||
Refer to the [`example`](./example) folder for an example on how to use quantum-viz.js. Notice that in order to open the contents of this folder in a browser you will need first to install from source (see [below](#running-from-source)).
|
||||
|
||||
3. Enable extensions by:
|
||||
```js
|
||||
const sampleDiv = document.getElementById('sample');
|
||||
qviz.create(sampleCircuit)
|
||||
.useDraggble() // drag and drop
|
||||
.usePanel() // edit and add panel
|
||||
.useOnCircuitChange(circuit => console.log(circuit)) // trigger when circuit changes
|
||||
.draw(sampleDiv)
|
||||
```
|
||||
|
||||
## Python usage
|
||||
|
||||
To use this package with Python, use [quantum-viz](/quantum-viz).
|
||||
|
|
Загрузка…
Ссылка в новой задаче