whitecanvas.tools
Built-in tools.
lasso_selector(canvas, buttons='left', modifiers=None, *, tracking=False)
Create a Lasso selector tool with given settings.
A Lasso selector emits a XYData object by freehand drawing. A selection tool is constructed by specifying the canvas to attach the tool.
canvas = new_canvas("matplotlib:qt") tool = lasso_selector(canvas)
Use buttons
and modifiers
to specify how to trigger the tool.
tool = lasso_selector(canvas, buttons="right", modifiers="ctrl")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas |
CanvasBase
|
The canvas to which the tool is attached. |
required |
buttons |
MouseButton or Sequence[MouseButton]
|
The mouse buttons that can trigger the tool. |
"left"
|
modifiers |
Modifier or Sequence[Modifier]
|
The modifier keys that must be pressed to trigger the tool. |
None
|
tracking |
bool
|
If True, the tool emits the changed signal while dragging. Otherwise, it emits the signal only when dragging is finished. |
False
|
Source code in whitecanvas\tools\_selection.py
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 |
|
line_selector(canvas, buttons='left', modifiers=None, *, tracking=False)
Create a line selector tool with given settings.
A line selector emits a LineSelection object when a line is drawn. A selection tool is constructed by specifying the canvas to attach the tool.
canvas = new_canvas("matplotlib:qt") tool = line_selector(canvas)
Use buttons
and modifiers
to specify how to trigger the tool.
tool = line_selector(canvas, buttons="right", modifiers="ctrl")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas |
CanvasBase
|
The canvas to which the tool is attached. |
required |
buttons |
MouseButton or Sequence[MouseButton]
|
The mouse buttons that can trigger the tool. |
"left"
|
modifiers |
Modifier or Sequence[Modifier]
|
The modifier keys that must be pressed to trigger the tool. |
None
|
tracking |
bool
|
If True, the tool emits the changed signal while dragging. Otherwise, it emits the signal only when dragging is finished. |
False
|
Source code in whitecanvas\tools\_selection.py
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
|
polygon_selector(canvas, buttons='left', modifiers=None, *, tracking=False)
Create a polygon selector tool with given settings.
A polygon selector emits a XYData object by freehand drawing. A selection tool is constructed by specifying the canvas to attach the tool.
canvas = new_canvas("matplotlib:qt") tool = polygon_selector(canvas)
Use buttons
and modifiers
to specify how to trigger the tool.
tool = polygon_selector(canvas, buttons="right", modifiers="ctrl")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas |
CanvasBase
|
The canvas to which the tool is attached. |
required |
buttons |
MouseButton or Sequence[MouseButton]
|
The mouse buttons that can trigger the tool. |
"left"
|
modifiers |
Modifier or Sequence[Modifier]
|
The modifier keys that must be pressed to trigger the tool. |
None
|
tracking |
bool
|
If True, the tool emits the changed signal while dragging. Otherwise, it emits the signal only when dragging is finished. |
False
|
Source code in whitecanvas\tools\_selection.py
705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
|
rect_selector(canvas, buttons='left', modifiers=None, *, tracking=False)
Create a rectangle selector tool with given settings.
A rectangle selector emits a Rect object when a rectangle is drawn. A selection tool is constructed by specifying the canvas to attach the tool.
canvas = new_canvas("matplotlib:qt") tool = rect_selector(canvas)
Use buttons
and modifiers
to specify how to trigger the tool.
tool = rect_selector(canvas, buttons="right", modifiers="ctrl")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas |
CanvasBase
|
The canvas to which the tool is attached. |
required |
buttons |
MouseButton or Sequence[MouseButton]
|
The mouse buttons that can trigger the tool. |
"left"
|
modifiers |
Modifier or Sequence[Modifier]
|
The modifier keys that must be pressed to trigger the tool. |
None
|
tracking |
bool
|
If True, the tool emits the changed signal while dragging. Otherwise, it emits the signal only when dragging is finished. |
False
|
Source code in whitecanvas\tools\_selection.py
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
xspan_selector(canvas, buttons='left', modifiers=None, *, tracking=False)
Create a x-span selector tool with given settings.
A x-span selector emits a SpanSelection object (tuple of start and end) when a span is drawn. A selection tool is constructed by specifying the canvas to attach the tool.
canvas = new_canvas("matplotlib:qt") tool = xspan_selector(canvas)
Use buttons
and modifiers
to specify how to trigger the tool.
tool = line_selector(canvas, buttons="right", modifiers="ctrl")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas |
CanvasBase
|
The canvas to which the tool is attached. |
required |
buttons |
MouseButton or Sequence[MouseButton]
|
The mouse buttons that can trigger the tool. |
"left"
|
modifiers |
Modifier or Sequence[Modifier]
|
The modifier keys that must be pressed to trigger the tool. |
None
|
tracking |
bool
|
If True, the tool emits the changed signal while dragging. Otherwise, it emits the signal only when dragging is finished. |
False
|
Source code in whitecanvas\tools\_selection.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
|
yspan_selector(canvas, buttons='left', modifiers=None, *, tracking=False)
Create a line selector tool with given settings.
A y-span selector emits a SpanSelection object (tuple of start and end) when a span is drawn. A selection tool is constructed by specifying the canvas to attach the tool.
canvas = new_canvas("matplotlib:qt") tool = yspan_selector(canvas)
Use buttons
and modifiers
to specify how to trigger the tool.
tool = line_selector(canvas, buttons="right", modifiers="ctrl")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas |
CanvasBase
|
The canvas to which the tool is attached. |
required |
buttons |
MouseButton or Sequence[MouseButton]
|
The mouse buttons that can trigger the tool. |
"left"
|
modifiers |
Modifier or Sequence[Modifier]
|
The modifier keys that must be pressed to trigger the tool. |
None
|
tracking |
bool
|
If True, the tool emits the changed signal while dragging. Otherwise, it emits the signal only when dragging is finished. |
False
|
Source code in whitecanvas\tools\_selection.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 |
|