Timeline
textual_timepiece.timeline
¶
Widgets for displaying & interacting with data on a timeline scale.
CLASS | DESCRIPTION |
---|---|
VerticalTimeline |
Timeline that displays entries in a vertical view. |
VerticalEntry |
Vertical entry for a vertical timeline layout. |
VerticalTimelineNavigation |
Vertical widget containing a vertical timeline and header. |
VerticalRuler |
Vertical ruler for marking vertical timelines. |
RuledVerticalTimeline |
Ruled vertical timeline with markers. |
HorizontalTimeline |
Timeline that displays entries in a horizontal view. |
HorizontalEntry |
Horizontal entry for a horizontal timeline layout. |
HorizontalTimelineNavigation |
Horizontal widget containing a horizontal timeline and header. |
HorizontalRuler |
Horizontal ruler for marking horizontal timelines. |
RuledHorizontalTimeline |
Ruled horizontal timeline with markers. |
VerticalTimeline
¶
Bases: AbstractTimeline[VerticalEntryType]
Timeline that displays entries in a vertical view.
PARAMETER | DESCRIPTION |
---|---|
*children
|
Entries to intially add to the widget.
TYPE:
|
duration
|
Size of the widget.
TYPE:
|
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
tile
|
Whether to tile the timeline or not. Set to
TYPE:
|
CLASS | DESCRIPTION |
---|---|
Updated |
Base class for all timeline messages. |
Created |
Sent when a new entry is created. |
Deleted |
Sent when an entry is deleted. |
Selected |
Sent when a new entry selected. |
METHOD | DESCRIPTION |
---|---|
action_delete_entry |
Remove the selected or provided entry from the timeline. |
action_adjust_tail |
Adjust the tail of the selected timeline entry. |
action_adjust_head |
Adjust the head of the selected timeline entry. |
refresh_line |
Refresh a single line. |
ATTRIBUTE | DESCRIPTION |
---|---|
BINDINGS |
All bindings for
TYPE:
|
COMPONENT_CLASSES |
All component classes for the |
length |
Actual size of the widget with the direction size of the widget.
|
markers |
Custom markers to place on the timeline.
|
tile |
Is calendar tiling enabled?
TYPE:
|
selected |
Currently highlighted entry. None if there is nothing selected.
TYPE:
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
|
BINDINGS
class-attribute
¶
BINDINGS: list[BindingType] = [
Binding(
"ctrl+down,ctrl+right",
"adjust_tail",
tooltip="Move entry to the backward.",
),
Binding(
"ctrl+up,ctrl+left",
"adjust_head",
tooltip="Move entry to the forward.",
),
Binding(
"alt+shift+down,alt+shift+left",
"adjust_tail(True, True)",
tooltip="Resize the tail end of the entry.",
),
Binding(
"alt+shift+up,alt+shift+right",
"adjust_head(True, True)",
tooltip="Resize the end of the entry forward.",
),
Binding(
"shift+up,shift+left",
"adjust_head(False, True)",
tooltip="Resize the start of the entry backward.",
),
Binding(
"shift+down,shift+right",
"adjust_tail(False, True)",
tooltip="Move the head of the entry forward.",
),
Binding(
"ctrl+d,delete,backspace",
"delete_entry",
"Delete Entry",
tooltip="Delete the selected entry.",
),
Binding(
"escape",
"clear_active",
"Clear",
priority=True,
show=False,
tooltip="Cancel creating an entry or deselect entries.",
),
]
All bindings for AbstractTimeline
widget.
Key(s) | Description |
---|---|
ctrl+down,ctrl+right | Move entry to the backward. |
ctrl+up,ctrl+left | Move entry to the forward. |
alt+shift+down,alt+shift+left | Resize the tail end of the entry. |
alt+shift+up,alt+shift+right | Resize the end of the entry forward. |
shift+up,shift+left | Resize the start of the entry backward. |
shift+down,shift+right | Move the head of the entry forward. |
ctrl+d,delete,backspace | Delete the selected entry. |
escape | Cancel creating an entry or deselect entries. |
COMPONENT_CLASSES
class-attribute
¶
All component classes for the AbstractTimeline
widget.
Class | Description |
---|---|
timeline--normal |
Target all lines without set markers. |
length
class-attribute
instance-attribute
¶
Actual size of the widget with the direction size of the widget.
markers
class-attribute
instance-attribute
¶
markers = Reactive[Markers](
MappingProxyType({}), init=False, compute=False, repaint=False
)
Custom markers to place on the timeline.
selected
property
¶
selected: EntryType | None
Currently highlighted entry. None if there is nothing selected.
DEFAULT_CSS
class-attribute
¶
VerticalTimeline {
height: auto !important;
border-left: wide $secondary;
border-right: wide $secondary;
&:hover {
border-left: thick $secondary;
border-right: thick $secondary;
}
&:focus {
border-left: outer $primary;
border-right: outer $primary;
}
}
Default CSS for VerticalTimeline
widget.
Updated
¶
Bases: BaseMessage[TimelineType]
, Generic[EntryT, TimelineType]
Base class for all timeline messages.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
Created
¶
Bases: Created[VerticalEntryT, VerticalTimelineType]
Sent when a new entry is created.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
454 455 456 457 |
|
Deleted
¶
Bases: Deleted[VerticalEntryT, VerticalTimelineType]
Sent when an entry is deleted.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
459 460 461 462 |
|
Selected
¶
Bases: Selected[VerticalEntryT, VerticalTimelineType]
Sent when a new entry selected.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
464 465 466 467 |
|
action_delete_entry
¶
action_delete_entry(id: str | None = None) -> None
Remove the selected or provided entry from the timeline.
PARAMETER | DESCRIPTION |
---|---|
id
|
If removing an un-highlighted widget.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
action_adjust_tail
¶
Adjust the tail of the selected timeline entry.
PARAMETER | DESCRIPTION |
---|---|
tail
|
Increase the size if resizing.
TYPE:
|
resize
|
Resize the entry instead of moving.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
action_adjust_head
¶
Adjust the head of the selected timeline entry.
PARAMETER | DESCRIPTION |
---|---|
tail
|
Increase the size if resizing.
TYPE:
|
resize
|
Resize the entry instead of moving.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
refresh_line
¶
refresh_line(y: int) -> None
Refresh a single line.
PARAMETER | DESCRIPTION |
---|---|
y
|
Coordinate of line.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
|
VerticalEntry
¶
Bases: AbstractEntry
Vertical entry for a vertical timeline layout.
PARAMETER | DESCRIPTION |
---|---|
id
|
ID of the Widget.
TYPE:
|
content
|
A Rich renderable, or string containing console markup.
TYPE:
|
offset
|
Initial offset to use for the entry.
TYPE:
|
size
|
Initial size to use for the entry.
TYPE:
|
markup
|
True if markup should be parsed and rendered.
TYPE:
|
name
|
Name of widget.
TYPE:
|
classes
|
Space separated list of class names.
TYPE:
|
disabled
|
Whether the static is disabled or not.
TYPE:
|
CLASS | DESCRIPTION |
---|---|
Updated |
Base message for all entries. |
Resized |
Entry was resized by the user. |
Moved |
Entry was moved by the user. |
METHOD | DESCRIPTION |
---|---|
mime |
Instatiate a mime entry. For previewing resizing visually. |
resize |
Public method for resizing the widget. |
is_moving |
Is the widget moving or resizing? |
ATTRIBUTE | DESCRIPTION |
---|---|
clicked |
Initial point where the entry was clicked when moving or resizing.
|
dimension |
Alias for the size of the entry depending on orientation.
TYPE:
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_timeline_entry.py
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
|
clicked
class-attribute
instance-attribute
¶
Initial point where the entry was clicked when moving or resizing.
dimension
property
writable
¶
dimension: int
Alias for the size of the entry depending on orientation.
DEFAULT_CSS
class-attribute
¶
VerticalEntry {
width: 100%;
min-height: 2;
height: 2;
border-top: double $panel-lighten-2;
border-bottom: double $panel-lighten-2;
&:hover.size_start {
border: none;
border-top: double $secondary;
border-bottom: double $panel-lighten-2;
}
&:hover.size_end {
border: none;
border-bottom: double $secondary;
border-top: double $panel-lighten-2;
}
&:focus.size_start {
border: none;
border-top: thick $primary;
border-bottom: double $primary;
}
&:focus.size_end {
border: none;
border-bottom: thick $primary;
border-top: double $primary;
}
&:focus {
border: double $primary;
}
&.-mime {
hatch: horizontal white 5%;
}
}
Default CSS for VerticalEntry
widget.
Updated
¶
Bases: BaseMessage[T]
Base message for all entries.
Source code in src/textual_timepiece/timeline/_timeline_entry.py
55 56 57 58 59 60 |
|
Resized
¶
Bases: Resized['VerticalEntry']
Entry was resized by the user.
Source code in src/textual_timepiece/timeline/_timeline_entry.py
375 376 |
|
Moved
¶
Bases: Moved['VerticalEntry']
Entry was moved by the user.
Source code in src/textual_timepiece/timeline/_timeline_entry.py
378 379 |
|
mime
classmethod
¶
mime(
offset: int | None = None,
size: int | None = None,
*,
name: str | None = None,
markup: bool = True,
disabled: bool = False,
) -> Self
Instatiate a mime entry. For previewing resizing visually.
PARAMETER | DESCRIPTION |
---|---|
offset
|
Initial offset to use for the entry.
TYPE:
|
size
|
Initial size to use for the entry.
TYPE:
|
markup
|
True if markup should be parsed and rendered.
TYPE:
|
name
|
Name of widget.
TYPE:
|
disabled
|
Whether the static is disabled or not.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Self
|
Constructed timeline entry. |
Source code in src/textual_timepiece/timeline/_timeline_entry.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
resize
¶
Public method for resizing the widget.
PARAMETER | DESCRIPTION |
---|---|
delta
|
total amount to be moved.
TYPE:
|
tail
|
Whether to adjust the end or the start of the widget.
TYPE:
|
Source code in src/textual_timepiece/timeline/_timeline_entry.py
224 225 226 227 228 229 230 231 232 |
|
is_moving
¶
Is the widget moving or resizing?
PARAMETER | DESCRIPTION |
---|---|
offset
|
Mouse offset to check against.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the widget is moving else False. |
Source code in src/textual_timepiece/timeline/_timeline_entry.py
287 288 289 290 291 292 293 294 295 296 |
|
VerticalTimelineNavigation
¶
Bases: TimelineNavigation[VerticalTimeline[VerticalEntryType]]
Vertical widget containing a vertical timeline and header.
PARAMETER | DESCRIPTION |
---|---|
header
|
Header to use at the start of the timeline.
TYPE:
|
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
ATTRIBUTE | DESCRIPTION |
---|---|
length |
Actual length of the actual timeline navigation.
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 |
|
VerticalRuler
¶
Bases: AbstractRuler
Vertical ruler for marking vertical timelines.
PARAMETER | DESCRIPTION |
---|---|
duration
|
Total length of the ruler.
TYPE:
|
marker_factory
|
Callable for creating the markers.
TYPE:
|
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
ATTRIBUTE | DESCRIPTION |
---|---|
duration |
Total time actual time the ruler spans in seconds.
|
length |
Actual length of the widget.
|
subdivisions |
Amount of subdivisions to use when calculating markers.
|
time_chunk |
Time chunk for each subdivision that the ruler creates.
|
marker_len |
The marker length of the each time_chunk.
|
DEFAULT_CSS |
Default CSS for the
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
|
duration
class-attribute
instance-attribute
¶
Total time actual time the ruler spans in seconds.
length
class-attribute
instance-attribute
¶
Actual length of the widget.
subdivisions
class-attribute
instance-attribute
¶
Amount of subdivisions to use when calculating markers.
Generator gets called this amount of times.
time_chunk
class-attribute
instance-attribute
¶
Time chunk for each subdivision that the ruler creates.
Computed automatically when other reactives change.
marker_len
class-attribute
instance-attribute
¶
The marker length of the each time_chunk.
DEFAULT_CSS
class-attribute
¶
VerticalRuler {
border-left: wide $secondary;
border-right: wide $secondary;
height: auto !important;
width: 8;
}
Default CSS for the VerticalRuler
widget.
RuledVerticalTimeline
¶
Bases: AbstractRuledTimeline[VerticalTimelineNavigation, VerticalRuler]
Ruled vertical timeline with markers.
Note
If providing headers with the header_factory
parameter make
sure to compensate with top padding for the ruler to keep alignment
in place.
PARAMETER | DESCRIPTION |
---|---|
total
|
Total amount of timelines to draw.
TYPE:
|
marker_factory
|
Factory function for creating markers on the ruler. Defaults to generating markers in the HH:mm format.
TYPE:
|
header_factory
|
Factory function for creating headers. |
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
can_maximize
|
Whether the widget can be maximized or not.
TYPE:
|
ATTRIBUTE | DESCRIPTION |
---|---|
total |
Total amount of timelines to compose. Minimum 1.
|
duration |
Total time included in widget in seconds.
|
length |
Actual length of the timelines.
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_timeline_manager.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
|
total
class-attribute
instance-attribute
¶
Total amount of timelines to compose. Minimum 1.
duration
class-attribute
instance-attribute
¶
Total time included in widget in seconds.
length
class-attribute
instance-attribute
¶
Actual length of the timelines.
DEFAULT_CSS
class-attribute
¶
RuledVerticalTimeline {
layout: horizontal;
width: 1fr;
& > VerticalTimelineNavigation {
width: 1fr;
& > VerticalTimeline {
width: 1fr;
}
}
}
Default CSS for RuledVerticalTimeline
widget.
HorizontalTimeline
¶
Bases: AbstractTimeline[HorizontalEntryType]
Timeline that displays entries in a horizontal view.
PARAMETER | DESCRIPTION |
---|---|
*children
|
Entries to intially add to the widget.
TYPE:
|
duration
|
Size of the widget.
TYPE:
|
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
tile
|
Whether to tile the timeline or not. Set to
TYPE:
|
CLASS | DESCRIPTION |
---|---|
Updated |
Base class for all timeline messages. |
Created |
Sent when a new entry is created. |
Deleted |
Sent when an entry is deleted. |
Selected |
Sent when a new entry selected. |
METHOD | DESCRIPTION |
---|---|
action_delete_entry |
Remove the selected or provided entry from the timeline. |
action_adjust_tail |
Adjust the tail of the selected timeline entry. |
action_adjust_head |
Adjust the head of the selected timeline entry. |
ATTRIBUTE | DESCRIPTION |
---|---|
BINDINGS |
All bindings for
TYPE:
|
COMPONENT_CLASSES |
All component classes for the |
length |
Actual size of the widget with the direction size of the widget.
|
markers |
Custom markers to place on the timeline.
|
tile |
Is calendar tiling enabled?
TYPE:
|
selected |
Currently highlighted entry. None if there is nothing selected.
TYPE:
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
550 551 552 553 554 555 556 557 558 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 593 594 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 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
|
BINDINGS
class-attribute
¶
BINDINGS: list[BindingType] = [
Binding(
"ctrl+down,ctrl+right",
"adjust_tail",
tooltip="Move entry to the backward.",
),
Binding(
"ctrl+up,ctrl+left",
"adjust_head",
tooltip="Move entry to the forward.",
),
Binding(
"alt+shift+down,alt+shift+left",
"adjust_tail(True, True)",
tooltip="Resize the tail end of the entry.",
),
Binding(
"alt+shift+up,alt+shift+right",
"adjust_head(True, True)",
tooltip="Resize the end of the entry forward.",
),
Binding(
"shift+up,shift+left",
"adjust_head(False, True)",
tooltip="Resize the start of the entry backward.",
),
Binding(
"shift+down,shift+right",
"adjust_tail(False, True)",
tooltip="Move the head of the entry forward.",
),
Binding(
"ctrl+d,delete,backspace",
"delete_entry",
"Delete Entry",
tooltip="Delete the selected entry.",
),
Binding(
"escape",
"clear_active",
"Clear",
priority=True,
show=False,
tooltip="Cancel creating an entry or deselect entries.",
),
]
All bindings for AbstractTimeline
widget.
Key(s) | Description |
---|---|
ctrl+down,ctrl+right | Move entry to the backward. |
ctrl+up,ctrl+left | Move entry to the forward. |
alt+shift+down,alt+shift+left | Resize the tail end of the entry. |
alt+shift+up,alt+shift+right | Resize the end of the entry forward. |
shift+up,shift+left | Resize the start of the entry backward. |
shift+down,shift+right | Move the head of the entry forward. |
ctrl+d,delete,backspace | Delete the selected entry. |
escape | Cancel creating an entry or deselect entries. |
COMPONENT_CLASSES
class-attribute
¶
All component classes for the AbstractTimeline
widget.
Class | Description |
---|---|
timeline--normal |
Target all lines without set markers. |
length
class-attribute
instance-attribute
¶
Actual size of the widget with the direction size of the widget.
markers
class-attribute
instance-attribute
¶
markers = Reactive[Markers](
MappingProxyType({}), init=False, compute=False, repaint=False
)
Custom markers to place on the timeline.
selected
property
¶
selected: EntryType | None
Currently highlighted entry. None if there is nothing selected.
DEFAULT_CSS
class-attribute
¶
HorizontalTimeline {
width: auto !important;
height: 28;
border-top: tall $secondary;
border-bottom: tall $secondary;
&:hover {
border-top: thick $secondary;
border-bottom: thick $secondary;
}
&:focus {
border-top: outer $primary;
border-bottom: outer $primary;
}
}
Default CSS for HorizontalTimeline
widget.
Updated
¶
Bases: BaseMessage[TimelineType]
, Generic[EntryT, TimelineType]
Base class for all timeline messages.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
Created
¶
Bases: Created[HorizontalEntryT, HorizontalTimelineType]
Sent when a new entry is created.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
585 586 587 588 |
|
Deleted
¶
Bases: Deleted[HorizontalEntryT, HorizontalTimelineType]
Sent when an entry is deleted.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
590 591 592 593 |
|
Selected
¶
Bases: Selected[HorizontalEntryT, HorizontalTimelineType]
Sent when a new entry selected.
ATTRIBUTE | DESCRIPTION |
---|---|
entry |
Entry that was updated.
|
timeline |
Alias for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
595 596 597 598 |
|
action_delete_entry
¶
action_delete_entry(id: str | None = None) -> None
Remove the selected or provided entry from the timeline.
PARAMETER | DESCRIPTION |
---|---|
id
|
If removing an un-highlighted widget.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
action_adjust_tail
¶
Adjust the tail of the selected timeline entry.
PARAMETER | DESCRIPTION |
---|---|
tail
|
Increase the size if resizing.
TYPE:
|
resize
|
Resize the entry instead of moving.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
action_adjust_head
¶
Adjust the head of the selected timeline entry.
PARAMETER | DESCRIPTION |
---|---|
tail
|
Increase the size if resizing.
TYPE:
|
resize
|
Resize the entry instead of moving.
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
HorizontalEntry
¶
Bases: AbstractEntry
Horizontal entry for a horizontal timeline layout.
PARAMETER | DESCRIPTION |
---|---|
id
|
ID of the Widget.
TYPE:
|
content
|
A Rich renderable, or string containing console markup.
TYPE:
|
offset
|
Initial offset to use for the entry.
TYPE:
|
size
|
Initial size to use for the entry.
TYPE:
|
markup
|
True if markup should be parsed and rendered.
TYPE:
|
name
|
Name of widget.
TYPE:
|
classes
|
Space separated list of class names.
TYPE:
|
disabled
|
Whether the static is disabled or not.
TYPE:
|
CLASS | DESCRIPTION |
---|---|
Updated |
Base message for all entries. |
Resized |
Entry was resized by the user. |
Moved |
Entry was moved by the user. |
METHOD | DESCRIPTION |
---|---|
mime |
Instatiate a mime entry. For previewing resizing visually. |
resize |
Public method for resizing the widget. |
is_moving |
Is the widget moving or resizing? |
ATTRIBUTE | DESCRIPTION |
---|---|
clicked |
Initial point where the entry was clicked when moving or resizing.
|
dimension |
Alias for the size of the entry depending on orientation.
TYPE:
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_timeline_entry.py
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 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 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 |
|
clicked
class-attribute
instance-attribute
¶
Initial point where the entry was clicked when moving or resizing.
dimension
property
writable
¶
dimension: int
Alias for the size of the entry depending on orientation.
DEFAULT_CSS
class-attribute
¶
HorizontalEntry {
min-width: 2;
width: 4;
height: 100%;
border-left: double $panel-lighten-2;
border-right: double $panel-lighten-2;
&:hover.size_start {
border: none;
border-left: double $secondary;
border-right: double $panel-lighten-2;
}
&:hover.size_end {
border: none;
border-right: double $secondary;
border-left: double $panel-lighten-2;
}
&:focus.size_start {
border: none;
border-left: thick $primary;
border-right: double $primary;
}
&:focus.size_end {
border: none;
border-left: double $primary;
border-right: thick $primary;
}
&:focus {
border: double $primary;
}
&.-mime {
hatch: vertical white 5%;
}
}
Default CSS for HorizontalEntry
widget.
Updated
¶
Bases: BaseMessage[T]
Base message for all entries.
Source code in src/textual_timepiece/timeline/_timeline_entry.py
55 56 57 58 59 60 |
|
Resized
¶
Bases: Resized['HorizontalEntry']
Entry was resized by the user.
Source code in src/textual_timepiece/timeline/_timeline_entry.py
488 489 |
|
Moved
¶
Bases: Moved['HorizontalEntry']
Entry was moved by the user.
Source code in src/textual_timepiece/timeline/_timeline_entry.py
491 492 |
|
mime
classmethod
¶
mime(
offset: int | None = None,
size: int | None = None,
*,
name: str | None = None,
markup: bool = True,
disabled: bool = False,
) -> Self
Instatiate a mime entry. For previewing resizing visually.
PARAMETER | DESCRIPTION |
---|---|
offset
|
Initial offset to use for the entry.
TYPE:
|
size
|
Initial size to use for the entry.
TYPE:
|
markup
|
True if markup should be parsed and rendered.
TYPE:
|
name
|
Name of widget.
TYPE:
|
disabled
|
Whether the static is disabled or not.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Self
|
Constructed timeline entry. |
Source code in src/textual_timepiece/timeline/_timeline_entry.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
resize
¶
Public method for resizing the widget.
PARAMETER | DESCRIPTION |
---|---|
delta
|
total amount to be moved.
TYPE:
|
tail
|
Whether to adjust the end or the start of the widget.
TYPE:
|
Source code in src/textual_timepiece/timeline/_timeline_entry.py
224 225 226 227 228 229 230 231 232 |
|
is_moving
¶
Is the widget moving or resizing?
PARAMETER | DESCRIPTION |
---|---|
offset
|
Mouse offset to check against.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the widget is moving else False. |
Source code in src/textual_timepiece/timeline/_timeline_entry.py
287 288 289 290 291 292 293 294 295 296 |
|
HorizontalTimelineNavigation
¶
Bases: TimelineNavigation[HorizontalTimeline[HorizontalEntryType]]
Horizontal widget containing a horizontal timeline and header.
PARAMETER | DESCRIPTION |
---|---|
header
|
Header to use at the start of the timeline.
TYPE:
|
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
ATTRIBUTE | DESCRIPTION |
---|---|
length |
Actual length of the actual timeline navigation.
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 |
|
HorizontalRuler
¶
Bases: AbstractRuler
Horizontal ruler for marking horizontal timelines.
PARAMETER | DESCRIPTION |
---|---|
duration
|
Total length of the ruler.
TYPE:
|
marker_factory
|
Callable for creating the markers.
TYPE:
|
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
ATTRIBUTE | DESCRIPTION |
---|---|
duration |
Total time actual time the ruler spans in seconds.
|
length |
Actual length of the widget.
|
subdivisions |
Amount of subdivisions to use when calculating markers.
|
time_chunk |
Time chunk for each subdivision that the ruler creates.
|
marker_len |
The marker length of the each time_chunk.
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_base_timeline.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 |
|
duration
class-attribute
instance-attribute
¶
Total time actual time the ruler spans in seconds.
length
class-attribute
instance-attribute
¶
Actual length of the widget.
subdivisions
class-attribute
instance-attribute
¶
Amount of subdivisions to use when calculating markers.
Generator gets called this amount of times.
time_chunk
class-attribute
instance-attribute
¶
Time chunk for each subdivision that the ruler creates.
Computed automatically when other reactives change.
marker_len
class-attribute
instance-attribute
¶
The marker length of the each time_chunk.
DEFAULT_CSS
class-attribute
¶
HorizontalRuler {
border-top: tall $secondary;
border-bottom: tall $secondary;
width: auto !important;
height: 3;
hatch: vertical white 5%;
}
Default CSS for HorizontalRuler
widget.
RuledHorizontalTimeline
¶
Bases: AbstractRuledTimeline[HorizontalTimelineNavigation, HorizontalRuler]
Ruled horizontal timeline with markers.
Note
If providing headers with the header_factory
parameter make
sure to compensate with left padding for the ruler to keep alignment
in place.
PARAMETER | DESCRIPTION |
---|---|
total
|
Total amount of timelines to draw.
TYPE:
|
marker_factory
|
Factory function for creating markers on the ruler. Defaults to generating markers in the HH:mm format.
TYPE:
|
header_factory
|
Factory function for creating headers. |
name
|
The name of the widget.
TYPE:
|
id
|
The ID of the widget in the DOM.
TYPE:
|
classes
|
The CSS classes for the widget.
TYPE:
|
disabled
|
Whether the widget is disabled or not.
TYPE:
|
can_maximize
|
Whether the widget can be maximized or not.
TYPE:
|
ATTRIBUTE | DESCRIPTION |
---|---|
total |
Total amount of timelines to compose. Minimum 1.
|
duration |
Total time included in widget in seconds.
|
DEFAULT_CSS |
Default CSS for
TYPE:
|
Source code in src/textual_timepiece/timeline/_timeline_manager.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
total
class-attribute
instance-attribute
¶
Total amount of timelines to compose. Minimum 1.
duration
class-attribute
instance-attribute
¶
Total time included in widget in seconds.
DEFAULT_CSS
class-attribute
¶
RuledHorizontalTimeline {
height: 1fr;
& > HorizontalTimelineNavigation {
height: 1fr;
& > HorizontalTimeline {
height: 1fr;
}
}
}
Default CSS for RuledHorizontalTimeline
widget.