components
WHTML
Magic class that takes html text and creates an object that is rendered with that text.
ipywidget.HTML
widgets do not get their links XSRF protected, but obj._repr_html_
does!
Warnings
This HTML is not escaped, so could do bad stuff!
Source code in cassini/ext/ipygui/components.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
UnescapedDataFrame
Bases: DataFrame
Subclass of pd.DataFrame
that slightly dangerously does not escape any html in its self._repr_html_
method.
Warnings
This class deliberately does not escape HTML for objects it contains. This means you need to trust these objects.
Source code in cassini/ext/ipygui/components.py
136 137 138 139 140 141 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 |
|
try_html_repr
staticmethod
try_html_repr(obj)
Get text form of obj, first try obj._repr_html_
, fallback on str(obj)
.
Warnings
This method does not escape obj._repr_html_
. So make sure your reprs are trustworthy!
Source code in cassini/ext/ipygui/components.py
145 146 147 148 149 150 151 152 153 154 155 156 |
|
InputSequence
Helper class for creating 'input sequences' i.e. a sequency of widgets that you fill in, and then click confirm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
done_action |
callable
|
function to call when confirm is clicked. |
required |
*children |
ipywidget
|
widgets to display in order. When confirm clicked, these widget objects are passed to done_action. |
()
|
Source code in cassini/ext/ipygui/components.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 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 253 254 255 256 257 258 259 260 261 262 263 |
|
reset
reset(change)
Reset the state of the InputSequence. Called when new
button clicked.
Source code in cassini/ext/ipygui/components.py
207 208 209 210 211 212 213 214 215 216 217 |
|
child_updated
child_updated(change)
Called when a child is updated, meant to stop you pressing confirm until you've entered something into every widget... don't think it actually works tho!
Source code in cassini/ext/ipygui/components.py
219 220 221 222 223 224 225 |
|
as_widget
as_widget()
Build self
into ipywidget
Returns:
Name | Type | Description |
---|---|---|
widget |
DOMWidget
|
widget form of self. |
Source code in cassini/ext/ipygui/components.py
227 228 229 230 231 232 233 234 235 236 |
|
display
display()
Displays self.as_widget()
.
Returns:
Name | Type | Description |
---|---|---|
output |
Output
|
output widget which we displayed into... |
Source code in cassini/ext/ipygui/components.py
238 239 240 241 242 243 244 245 246 247 248 |
|
BaseTierGui
Bases: Generic[T]
Mixin to provide nice notebook outputs for Jupyter Notebooks.
Source code in cassini/ext/ipygui/components.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 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 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 |
|
header
header(*, include=None, exclude=None)
Builds header widget from its components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include |
Sequence[str]
|
names of components to render in header widget. |
None
|
exclude |
Sequence[str]
|
names of components not to render in header widget. |
None
|
Notes
Parameters include and exclude are mutually exclusive.
Returns:
Name | Type | Description |
---|---|---|
header |
DOMWidget
|
Widget that can be displayed containing all the components of this |
Source code in cassini/ext/ipygui/components.py
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 |
|
display_highlights
display_highlights()
Display an ipywidgets.Accordian
with this Tier
's highlights.
Source code in cassini/ext/ipygui/components.py
461 462 463 464 465 |
|
children_df
children_df(*, include=None, exclude=None)
Calls tier.children_df
but returns an UnescapedDataFrame
instead.
Source code in cassini/ext/ipygui/components.py
467 468 469 470 471 472 473 474 475 476 477 |
|
new_child
new_child()
Widget for creating new child for this Tier
.
Source code in cassini/ext/ipygui/components.py
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 |
|
widgetify
widgetify(obj)
Allows any object to be treated like an ipywidget
so it can be used in ipywidget
layouts - handy!
Source code in cassini/ext/ipygui/components.py
110 111 112 113 114 115 116 117 |
|
widgetify_html
widgetify_html(html)
Required for html which has links rather than ipywidgets HTML widget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
html |
str
|
HTML to render |
required |
Returns:
Type | Description |
---|---|
Output widget containing the HTML
|
|
Source code in cassini/ext/ipygui/components.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|