Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -445,49 +445,6 @@ app_ui = ui.page_fluid(
|
|
445 |
,
|
446 |
|
447 |
ui.nav("Scorers Streamers",
|
448 |
-
ui.div(
|
449 |
-
ui.tags.head(
|
450 |
-
ui.tags.script({"src": "https://html2canvas.hertzen.com/dist/html2canvas.min.js"}),
|
451 |
-
ui.tags.style("""
|
452 |
-
#capture-div {
|
453 |
-
display: inline-block;
|
454 |
-
background-color: white;
|
455 |
-
padding: 20px;
|
456 |
-
width: fit-content;
|
457 |
-
height: fit-content;
|
458 |
-
}
|
459 |
-
.table-container {
|
460 |
-
width: auto;
|
461 |
-
height: auto;
|
462 |
-
}
|
463 |
-
""")
|
464 |
-
),
|
465 |
-
ui.row(ui.tags.button(
|
466 |
-
"Download as PNG",
|
467 |
-
{"onclick": """
|
468 |
-
html2canvas(document.getElementById('capture-div'), {
|
469 |
-
scale: 2,
|
470 |
-
useCORS: true,
|
471 |
-
backgroundColor: '#ffffff',
|
472 |
-
windowWidth: document.getElementById('capture-div').scrollWidth,
|
473 |
-
windowHeight: document.getElementById('capture-div').scrollHeight,
|
474 |
-
imageTimeout: 0,
|
475 |
-
removeContainer: true
|
476 |
-
}).then(function(canvas) {
|
477 |
-
var link = document.createElement('a');
|
478 |
-
link.download = 'nhl-streamers.png';
|
479 |
-
link.href = canvas.toDataURL('image/png', 1.0);
|
480 |
-
document.body.appendChild(link);
|
481 |
-
link.click();
|
482 |
-
document.body.removeChild(link);
|
483 |
-
}).catch(function(err) {
|
484 |
-
console.error('Error:', err);
|
485 |
-
});
|
486 |
-
"""},
|
487 |
-
{"style": "margin: 10px 0;"}
|
488 |
-
)),
|
489 |
-
ui.div(
|
490 |
-
{"id": "capture-div"},
|
491 |
ui.tags.h3(""),
|
492 |
ui.div({"style": "font-size:2.7em;"}, ui.output_text("txt_title_streamers")),
|
493 |
ui.tags.h5("Created By: @TJStats, Data: NHL, Natural Stat Trick, Yahoo Fantasy"),
|
@@ -499,53 +456,10 @@ app_ui = ui.page_fluid(
|
|
499 |
),
|
500 |
ui.tags.h3(""),
|
501 |
ui.div({"style": "font-size:2em;"}, ui.output_text("txt_title_streamers_roster_d")),
|
502 |
-
|
503 |
-
ui.div(
|
504 |
-
{"class": "table-container"},
|
505 |
-
ui.output_table("scorer_streamers_d")
|
506 |
)
|
507 |
-
)
|
508 |
-
)
|
509 |
-
),
|
510 |
|
511 |
ui.nav("Bangers Streamers",
|
512 |
-
ui.div(
|
513 |
-
ui.tags.head(
|
514 |
-
ui.tags.script({"src": "https://html2canvas.hertzen.com/dist/html2canvas.min.js"}),
|
515 |
-
ui.tags.style("""
|
516 |
-
#capture-div {
|
517 |
-
display: inline-block;
|
518 |
-
background-color: white;
|
519 |
-
padding: 20px;
|
520 |
-
width: fit-content;
|
521 |
-
height: fit-content;
|
522 |
-
}
|
523 |
-
.table-container {
|
524 |
-
width: auto;
|
525 |
-
height: auto;
|
526 |
-
}
|
527 |
-
""")
|
528 |
-
),
|
529 |
-
ui.row(ui.tags.button(
|
530 |
-
"Download as PNG",
|
531 |
-
{"onclick": """
|
532 |
-
html2canvas(document.getElementById('capture-div'), {
|
533 |
-
scale: 2,
|
534 |
-
useCORS: true,
|
535 |
-
backgroundColor: '#ffffff',
|
536 |
-
windowWidth: document.getElementById('capture-div').scrollWidth,
|
537 |
-
windowHeight: document.getElementById('capture-div').scrollHeight
|
538 |
-
}).then(function(canvas) {
|
539 |
-
var link = document.createElement('a');
|
540 |
-
link.download = 'nhl-banger-streamers.png';
|
541 |
-
link.href = canvas.toDataURL('image/png');
|
542 |
-
link.click();
|
543 |
-
});
|
544 |
-
"""},
|
545 |
-
{"style": "margin: 10px 0;"}
|
546 |
-
)),
|
547 |
-
ui.div(
|
548 |
-
{"id": "capture-div"},
|
549 |
ui.tags.h3(""),
|
550 |
ui.div({"style": "font-size:2.7em;"}, ui.output_text("txt_title_streamers_bang")),
|
551 |
ui.tags.h5("Created By: @TJStats, Data: NHL, Natural Stat Trick, Yahoo Fantasy"),
|
@@ -558,13 +472,10 @@ app_ui = ui.page_fluid(
|
|
558 |
ui.tags.h3(""),
|
559 |
ui.div({"style": "font-size:2em;"}, ui.output_text("txt_title_streamers_roster_d_bang")),
|
560 |
ui.div({"style": "font-size:1em;"}, ui.output_text("txt_title_streamers_dates_d_bang")),
|
561 |
-
ui.div(
|
562 |
-
{"class": "table-container"},
|
563 |
-
ui.output_table("banger_streamers_d")
|
564 |
)
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
|
569 |
|
570 |
|
|
|
445 |
,
|
446 |
|
447 |
ui.nav("Scorers Streamers",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
ui.tags.h3(""),
|
449 |
ui.div({"style": "font-size:2.7em;"}, ui.output_text("txt_title_streamers")),
|
450 |
ui.tags.h5("Created By: @TJStats, Data: NHL, Natural Stat Trick, Yahoo Fantasy"),
|
|
|
456 |
),
|
457 |
ui.tags.h3(""),
|
458 |
ui.div({"style": "font-size:2em;"}, ui.output_text("txt_title_streamers_roster_d")),
|
459 |
+
|
|
|
|
|
|
|
460 |
)
|
|
|
|
|
|
|
461 |
|
462 |
ui.nav("Bangers Streamers",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
ui.tags.h3(""),
|
464 |
ui.div({"style": "font-size:2.7em;"}, ui.output_text("txt_title_streamers_bang")),
|
465 |
ui.tags.h5("Created By: @TJStats, Data: NHL, Natural Stat Trick, Yahoo Fantasy"),
|
|
|
472 |
ui.tags.h3(""),
|
473 |
ui.div({"style": "font-size:2em;"}, ui.output_text("txt_title_streamers_roster_d_bang")),
|
474 |
ui.div({"style": "font-size:1em;"}, ui.output_text("txt_title_streamers_dates_d_bang")),
|
|
|
|
|
|
|
475 |
)
|
476 |
+
|
477 |
+
|
478 |
+
|
479 |
|
480 |
|
481 |
|