Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add panel feature #78

Open
wants to merge 110 commits into
base: feature/draggable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
a657785
Allow gates draggable
Jun 7, 2022
9a66bc8
Add description to addEditable function
Jun 7, 2022
d831c48
Add return types
Jun 7, 2022
1310814
Add tests
Jun 8, 2022
7c3d732
Revert renderCircuit to private
Jun 8, 2022
2a6a825
Trim trailing whitespace
Jun 8, 2022
623a977
Add license
Jun 8, 2022
6f56012
Fix + add tests to getWireElemY
Jun 8, 2022
2a06b95
Add tests for getGate + getParent
Jun 8, 2022
3e7dd43
Add test for addCustomStyles
Jun 8, 2022
b478d56
Add test for addDocumentEvents
Jun 8, 2022
42fb702
Add more tests
Jun 9, 2022
be06859
add tests for getClosestWireY
Jun 9, 2022
41bbf68
Add tests for getWireElemsY + addDropzoneEvents
Jun 9, 2022
6d9b5d5
Add tests for addMouseEvents
Jun 9, 2022
692250c
Remove svg id in snapshot
Jun 9, 2022
0dc44fc
Trim trailing whitespace
Jun 9, 2022
c397bfd
Trim trailing whitespace
Jun 9, 2022
e544eee
Exclude __tests__/ from pre-commit hook
Jun 9, 2022
f050742
Add callbackFn + documentation + tests
Jun 9, 2022
bf12e14
Remove pnpm-lock
Jun 9, 2022
4004380
Add tests for addDropzones
Jun 9, 2022
5620b60
Integrate editable styles in styles.ts
Jun 13, 2022
2c6be06
Display grab cursor style when hover over gates
Jun 13, 2022
009a1d7
Rename callbackFn to onCircuitChange
Jun 13, 2022
b46060b
Document instructions on Editable feature
Jun 13, 2022
4bfea11
Add license
Jun 13, 2022
e41f525
Only allow scrollbar if neccessary
Jun 13, 2022
8e0c9e6
Reimplement adding dropzones (#69)
aatng-gh Jun 28, 2022
605c64c
Update snapshots
Jun 28, 2022
bddc2d1
Update tests
Jun 28, 2022
4b22f07
Add tests for _center, _wireData
Jun 28, 2022
d975f88
Add tests for _equivOperation, _equivOperationParent
Jun 28, 2022
5daff51
Add tests for _moveX, _copyX
Jun 28, 2022
1c1d073
Add tests for _circularMod
Jun 28, 2022
2b36d73
Add tests for _offsetRecursively
Jun 28, 2022
6e2776c
Add tests for _moveY
Jun 28, 2022
ee00dc4
Add tests for _equivGateElem
Jun 28, 2022
f63ecc3
Add tests for _wirePrefixes
Jun 28, 2022
100e2aa
Add tests for _wireYs
Jun 28, 2022
47fc810
Add tests for _hostElems
Jun 28, 2022
cba0761
Remove unnecessary condition when copying
Jun 29, 2022
9fbe566
Clone operation when moving
Jun 29, 2022
cca0b1c
Reformat comments
Jun 29, 2022
0347a80
Reformat comments
Jun 29, 2022
69dedb2
Fix keyup behaviors
Jun 29, 2022
bc94aff
Overhaul comments
Jun 29, 2022
2f5e3f8
Fix add instead of remove cursor style
Jun 30, 2022
0019b5e
Rename _equivOperationParent to _equivParentArray
Jul 6, 2022
eb1ea55
Fix parent operation not updating to its children targets
Jul 6, 2022
2fe5929
Fix comment
Jul 7, 2022
352e74e
First commit new feature
Jul 7, 2022
22ff44b
Remove Context dependency
Jul 7, 2022
16639dc
Display data when gate is clicked
Jul 7, 2022
d45089b
Sync to `main` (#73)
aatng-gh Jul 7, 2022
48c2144
Allow target edit
Jul 11, 2022
6e90042
Merge branch 'aaron/panel' of https://github.com/microsoft/quantum-vi…
Jul 11, 2022
123c869
Change render mechanism
Jul 11, 2022
863b7d2
use Reducer design pattern
Jul 11, 2022
90b29bc
Add basic rendering
Jul 11, 2022
5b51043
Add extensions feature (#76)
aatng-gh Jul 13, 2022
2a5c35e
Sync with `main` (#77)
aatng-gh Jul 13, 2022
473914a
Add styles
Jul 13, 2022
acae203
Fix context
Jul 20, 2022
72357ba
Allow basic operation appending
Jul 20, 2022
b66957c
Allow toggling between Add or Edit Panel
Jul 20, 2022
acb6bb8
Add basic functionalities with Add Panel
Jul 21, 2022
59fd7e0
Basic drag and drop
Jul 25, 2022
ea16116
Basic Add Panel gate rendering
Jul 26, 2022
ab19cd0
Disable contextmenu & change cursor when dragging from Add Panel
Jul 26, 2022
74f2f5f
Remove unnecessary export
Jul 26, 2022
b1e06d3
Add rendering padding & comments
Jul 26, 2022
cbc1a5f
Let usePanel accepts user options
Jul 27, 2022
c82fd00
Rename useRender to useRefresh
Jul 27, 2022
094fe7b
Enable ghost element when dragging
Jul 27, 2022
e1f0d21
Add `options` functionalities in Add Panel
Jul 28, 2022
8fa5804
Refactor payload for addMode & cancel event when dragging
Jul 28, 2022
56285c3
Add more gates into defaultGateDictionary
Jul 28, 2022
b4d5127
Support Entangle in Add Panel
Jul 28, 2022
961963c
Fix selector bug
Jul 28, 2022
54b66fd
Rename editable to draggable tests
Jul 30, 2022
f2d8cd5
Add return signatures
Jul 30, 2022
7d2e05a
Update draggable snapshot
Jul 30, 2022
aef2eb0
Add tests
Jul 31, 2022
141f475
Add tests for addPanel
Jul 31, 2022
0ec4100
Add tests for panel
Jul 31, 2022
ec1c6b6
Reorganize imports
Jul 31, 2022
3fd1fb4
Add license
Aug 1, 2022
8224df6
Add documentation
Aug 1, 2022
7aef00f
Merge branch 'feature/draggable' into aaron/panel
aatng-gh Aug 1, 2022
1164630
Fix up comments
Aug 1, 2022
d82deda
Remove old tests
Aug 1, 2022
b79b88b
Remove old snapshots
Aug 1, 2022
5e7ec22
Increase panelWidth from 144 to 150
Aug 2, 2022
e36cb96
Update tests
Aug 3, 2022
4e4ff7c
Rename Display to Parameters
Aug 4, 2022
651efc2
Fix missing px in width
Aug 4, 2022
b77fe2d
Not display Parameters on X (Not) gate
Aug 4, 2022
943ce1c
Add conditions to element renders
Aug 4, 2022
6af8e75
Fix composed gates disappearing
Aug 4, 2022
4c3ec4d
Add Panel supports composed gates
Aug 4, 2022
89a91f1
Fix composed gate children don't change targets
Aug 4, 2022
197fa89
Set panelMinHeight
Aug 4, 2022
0f637be
Make customDictionary extended instead of replaced
Aug 4, 2022
05f8af4
Remove unnecessary useRefresh
Aug 4, 2022
ae819ed
Update tests
Aug 4, 2022
4c03bf0
More examples
Aug 5, 2022
c14219c
Add extension usage instruction
Aug 5, 2022
79b849a
Disable control checkboxes if already in targets
Aug 5, 2022
1e8f11c
Update tests
Aug 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Loading