Best JavaScript code snippet using wpt
output.ts
Source:output.ts
1import { PlanningSlot } from "./answer";2export default [3 {4 "startTime": "00:00",5 "endTime": "01:00",6 "day": "Monday"7 },8 {9 "startTime": "01:00",10 "endTime": "02:00",11 "day": "Monday"12 },13 {14 "startTime": "02:00",15 "endTime": "03:00",16 "day": "Monday"17 },18 {19 "startTime": "03:00",20 "endTime": "04:00",21 "day": "Monday"22 },23 {24 "startTime": "04:00",25 "endTime": "05:00",26 "day": "Monday"27 },28 {29 "startTime": "05:00",30 "endTime": "06:00",31 "day": "Monday"32 },33 {34 "startTime": "06:00",35 "endTime": "07:00",36 "day": "Monday"37 },38 {39 "startTime": "07:00",40 "endTime": "08:00",41 "day": "Monday"42 },43 {44 "startTime": "08:00",45 "endTime": "09:00",46 "day": "Monday"47 },48 {49 "startTime": "09:00",50 "endTime": "10:00",51 "day": "Monday",52 "event": {53 "day": "Monday",54 "startTime": "09:00",55 "endTime": "11:00",56 "name": "First work day!"57 }58 },59 {60 "startTime": "10:00",61 "endTime": "11:00",62 "day": "Monday",63 "event": {64 "day": "Monday",65 "startTime": "09:00",66 "endTime": "11:00",67 "name": "First work day!"68 }69 },70 {71 "startTime": "11:00",72 "endTime": "12:00",73 "day": "Monday"74 },75 {76 "startTime": "12:00",77 "endTime": "13:00",78 "day": "Monday"79 },80 {81 "startTime": "13:00",82 "endTime": "14:00",83 "day": "Monday"84 },85 {86 "startTime": "14:00",87 "endTime": "15:00",88 "day": "Monday"89 },90 {91 "startTime": "15:00",92 "endTime": "16:00",93 "day": "Monday"94 },95 {96 "startTime": "16:00",97 "endTime": "17:00",98 "day": "Monday"99 },100 {101 "startTime": "17:00",102 "endTime": "18:00",103 "day": "Monday"104 },105 {106 "startTime": "18:00",107 "endTime": "19:00",108 "day": "Monday"109 },110 {111 "startTime": "19:00",112 "endTime": "20:00",113 "day": "Monday"114 },115 {116 "startTime": "20:00",117 "endTime": "21:00",118 "day": "Monday"119 },120 {121 "startTime": "21:00",122 "endTime": "22:00",123 "day": "Monday"124 },125 {126 "startTime": "22:00",127 "endTime": "23:00",128 "day": "Monday"129 },130 {131 "startTime": "23:00",132 "endTime": "00:00",133 "day": "Monday"134 },135 {136 "startTime": "00:00",137 "endTime": "01:00",138 "day": "Tuesday"139 },140 {141 "startTime": "01:00",142 "endTime": "02:00",143 "day": "Tuesday"144 },145 {146 "startTime": "02:00",147 "endTime": "03:00",148 "day": "Tuesday"149 },150 {151 "startTime": "03:00",152 "endTime": "04:00",153 "day": "Tuesday"154 },155 {156 "startTime": "04:00",157 "endTime": "05:00",158 "day": "Tuesday"159 },160 {161 "startTime": "05:00",162 "endTime": "06:00",163 "day": "Tuesday"164 },165 {166 "startTime": "06:00",167 "endTime": "07:00",168 "day": "Tuesday"169 },170 {171 "startTime": "07:00",172 "endTime": "08:00",173 "day": "Tuesday"174 },175 {176 "startTime": "08:00",177 "endTime": "09:00",178 "day": "Tuesday"179 },180 {181 "startTime": "09:00",182 "endTime": "10:00",183 "day": "Tuesday",184 "event": {185 "day": "Tuesday",186 "startTime": "09:00",187 "endTime": "11:00",188 "name": "First meeting"189 }190 },191 {192 "startTime": "10:00",193 "endTime": "11:00",194 "day": "Tuesday",195 "event": {196 "day": "Tuesday",197 "startTime": "09:00",198 "endTime": "11:00",199 "name": "First meeting"200 }201 },202 {203 "startTime": "11:00",204 "endTime": "12:00",205 "day": "Tuesday",206 "event": {207 "day": "Tuesday",208 "startTime": "11:00",209 "endTime": "12:00",210 "name": "Pause after meeting"211 }212 },213 {214 "startTime": "12:00",215 "endTime": "13:00",216 "day": "Tuesday"217 },218 {219 "startTime": "13:00",220 "endTime": "14:00",221 "day": "Tuesday"222 },223 {224 "startTime": "14:00",225 "endTime": "15:00",226 "day": "Tuesday"227 },228 {229 "startTime": "15:00",230 "endTime": "16:00",231 "day": "Tuesday"232 },233 {234 "startTime": "16:00",235 "endTime": "17:00",236 "day": "Tuesday"237 },238 {239 "startTime": "17:00",240 "endTime": "18:00",241 "day": "Tuesday"242 },243 {244 "startTime": "18:00",245 "endTime": "19:00",246 "day": "Tuesday"247 },248 {249 "startTime": "19:00",250 "endTime": "20:00",251 "day": "Tuesday"252 },253 {254 "startTime": "20:00",255 "endTime": "21:00",256 "day": "Tuesday"257 },258 {259 "startTime": "21:00",260 "endTime": "22:00",261 "day": "Tuesday"262 },263 {264 "startTime": "22:00",265 "endTime": "23:00",266 "day": "Tuesday"267 },268 {269 "startTime": "23:00",270 "endTime": "00:00",271 "day": "Tuesday"272 },273 {274 "startTime": "00:00",275 "endTime": "01:00",276 "day": "Wednesday"277 },278 {279 "startTime": "01:00",280 "endTime": "02:00",281 "day": "Wednesday"282 },283 {284 "startTime": "02:00",285 "endTime": "03:00",286 "day": "Wednesday"287 },288 {289 "startTime": "03:00",290 "endTime": "04:00",291 "day": "Wednesday"292 },293 {294 "startTime": "04:00",295 "endTime": "05:00",296 "day": "Wednesday"297 },298 {299 "startTime": "05:00",300 "endTime": "06:00",301 "day": "Wednesday"302 },303 {304 "startTime": "06:00",305 "endTime": "07:00",306 "day": "Wednesday"307 },308 {309 "startTime": "07:00",310 "endTime": "08:00",311 "day": "Wednesday"312 },313 {314 "startTime": "08:00",315 "endTime": "09:00",316 "day": "Wednesday"317 },318 {319 "startTime": "09:00",320 "endTime": "10:00",321 "day": "Wednesday",322 "event": {323 "day": "Wednesday",324 "startTime": "09:00",325 "endTime": "12:00",326 "name": "Morning workshop"327 }328 },329 {330 "startTime": "10:00",331 "endTime": "11:00",332 "day": "Wednesday",333 "event": {334 "day": "Wednesday",335 "startTime": "09:00",336 "endTime": "12:00",337 "name": "Morning workshop"338 }339 },340 {341 "startTime": "11:00",342 "endTime": "12:00",343 "day": "Wednesday",344 "event": {345 "day": "Wednesday",346 "startTime": "09:00",347 "endTime": "12:00",348 "name": "Morning workshop"349 }350 },351 {352 "startTime": "12:00",353 "endTime": "13:00",354 "day": "Wednesday"355 },356 {357 "startTime": "13:00",358 "endTime": "14:00",359 "day": "Wednesday",360 "event": {361 "day": "Wednesday",362 "startTime": "13:00",363 "endTime": "18:00",364 "name": "Project afternoon"365 }366 },367 {368 "startTime": "14:00",369 "endTime": "15:00",370 "day": "Wednesday",371 "event": {372 "day": "Wednesday",373 "startTime": "13:00",374 "endTime": "18:00",375 "name": "Project afternoon"376 }377 },378 {379 "startTime": "15:00",380 "endTime": "16:00",381 "day": "Wednesday",382 "event": {383 "day": "Wednesday",384 "startTime": "13:00",385 "endTime": "18:00",386 "name": "Project afternoon"387 }388 },389 {390 "startTime": "16:00",391 "endTime": "17:00",392 "day": "Wednesday",393 "event": {394 "day": "Wednesday",395 "startTime": "13:00",396 "endTime": "18:00",397 "name": "Project afternoon"398 }399 },400 {401 "startTime": "17:00",402 "endTime": "18:00",403 "day": "Wednesday",404 "event": {405 "day": "Wednesday",406 "startTime": "13:00",407 "endTime": "18:00",408 "name": "Project afternoon"409 }410 },411 {412 "startTime": "18:00",413 "endTime": "19:00",414 "day": "Wednesday"415 },416 {417 "startTime": "19:00",418 "endTime": "20:00",419 "day": "Wednesday"420 },421 {422 "startTime": "20:00",423 "endTime": "21:00",424 "day": "Wednesday"425 },426 {427 "startTime": "21:00",428 "endTime": "22:00",429 "day": "Wednesday"430 },431 {432 "startTime": "22:00",433 "endTime": "23:00",434 "day": "Wednesday"435 },436 {437 "startTime": "23:00",438 "endTime": "00:00",439 "day": "Wednesday"440 },441 {442 "startTime": "00:00",443 "endTime": "01:00",444 "day": "Thursday"445 },446 {447 "startTime": "01:00",448 "endTime": "02:00",449 "day": "Thursday"450 },451 {452 "startTime": "02:00",453 "endTime": "03:00",454 "day": "Thursday"455 },456 {457 "startTime": "03:00",458 "endTime": "04:00",459 "day": "Thursday"460 },461 {462 "startTime": "04:00",463 "endTime": "05:00",464 "day": "Thursday"465 },466 {467 "startTime": "05:00",468 "endTime": "06:00",469 "day": "Thursday"470 },471 {472 "startTime": "06:00",473 "endTime": "07:00",474 "day": "Thursday"475 },476 {477 "startTime": "07:00",478 "endTime": "08:00",479 "day": "Thursday"480 },481 {482 "startTime": "08:00",483 "endTime": "09:00",484 "day": "Thursday"485 },486 {487 "startTime": "09:00",488 "endTime": "10:00",489 "day": "Thursday"490 },491 {492 "startTime": "10:00",493 "endTime": "11:00",494 "day": "Thursday"495 },496 {497 "startTime": "11:00",498 "endTime": "12:00",499 "day": "Thursday"500 },501 {502 "startTime": "12:00",503 "endTime": "13:00",504 "day": "Thursday"505 },506 {507 "startTime": "13:00",508 "endTime": "14:00",509 "day": "Thursday"510 },511 {512 "startTime": "14:00",513 "endTime": "15:00",514 "day": "Thursday"515 },516 {517 "startTime": "15:00",518 "endTime": "16:00",519 "day": "Thursday"520 },521 {522 "startTime": "16:00",523 "endTime": "17:00",524 "day": "Thursday"525 },526 {527 "startTime": "17:00",528 "endTime": "18:00",529 "day": "Thursday"530 },531 {532 "startTime": "18:00",533 "endTime": "19:00",534 "day": "Thursday"535 },536 {537 "startTime": "19:00",538 "endTime": "20:00",539 "day": "Thursday"540 },541 {542 "startTime": "20:00",543 "endTime": "21:00",544 "day": "Thursday"545 },546 {547 "startTime": "21:00",548 "endTime": "22:00",549 "day": "Thursday"550 },551 {552 "startTime": "22:00",553 "endTime": "23:00",554 "day": "Thursday"555 },556 {557 "startTime": "23:00",558 "endTime": "00:00",559 "day": "Thursday"560 },561 {562 "startTime": "00:00",563 "endTime": "01:00",564 "day": "Friday"565 },566 {567 "startTime": "01:00",568 "endTime": "02:00",569 "day": "Friday"570 },571 {572 "startTime": "02:00",573 "endTime": "03:00",574 "day": "Friday"575 },576 {577 "startTime": "03:00",578 "endTime": "04:00",579 "day": "Friday"580 },581 {582 "startTime": "04:00",583 "endTime": "05:00",584 "day": "Friday"585 },586 {587 "startTime": "05:00",588 "endTime": "06:00",589 "day": "Friday"590 },591 {592 "startTime": "06:00",593 "endTime": "07:00",594 "day": "Friday"595 },596 {597 "startTime": "07:00",598 "endTime": "08:00",599 "day": "Friday"600 },601 {602 "startTime": "08:00",603 "endTime": "09:00",604 "day": "Friday"605 },606 {607 "startTime": "09:00",608 "endTime": "10:00",609 "day": "Friday"610 },611 {612 "startTime": "10:00",613 "endTime": "11:00",614 "day": "Friday"615 },616 {617 "startTime": "11:00",618 "endTime": "12:00",619 "day": "Friday"620 },621 {622 "startTime": "12:00",623 "endTime": "13:00",624 "day": "Friday"625 },626 {627 "startTime": "13:00",628 "endTime": "14:00",629 "day": "Friday"630 },631 {632 "startTime": "14:00",633 "endTime": "15:00",634 "day": "Friday"635 },636 {637 "startTime": "15:00",638 "endTime": "16:00",639 "day": "Friday"640 },641 {642 "startTime": "16:00",643 "endTime": "17:00",644 "day": "Friday"645 },646 {647 "startTime": "17:00",648 "endTime": "18:00",649 "day": "Friday"650 },651 {652 "startTime": "18:00",653 "endTime": "19:00",654 "day": "Friday",655 "event": {656 "day": "Friday",657 "startTime": "18:00",658 "endTime": "00:00",659 "name": "Office party"660 }661 },662 {663 "startTime": "19:00",664 "endTime": "20:00",665 "day": "Friday",666 "event": {667 "day": "Friday",668 "startTime": "18:00",669 "endTime": "00:00",670 "name": "Office party"671 }672 },673 {674 "startTime": "20:00",675 "endTime": "21:00",676 "day": "Friday",677 "event": {678 "day": "Friday",679 "startTime": "18:00",680 "endTime": "00:00",681 "name": "Office party"682 }683 },684 {685 "startTime": "21:00",686 "endTime": "22:00",687 "day": "Friday",688 "event": {689 "day": "Friday",690 "startTime": "18:00",691 "endTime": "00:00",692 "name": "Office party"693 }694 },695 {696 "startTime": "22:00",697 "endTime": "23:00",698 "day": "Friday",699 "event": {700 "day": "Friday",701 "startTime": "18:00",702 "endTime": "00:00",703 "name": "Office party"704 }705 },706 {707 "startTime": "23:00",708 "endTime": "00:00",709 "day": "Friday",710 "event": {711 "day": "Friday",712 "startTime": "18:00",713 "endTime": "00:00",714 "name": "Office party"715 }716 },717 {718 "startTime": "00:00",719 "endTime": "01:00",720 "day": "Saturday",721 "event": {722 "day": "Saturday",723 "startTime": "00:00",724 "endTime": "01:00",725 "name": "Clean up time"726 }727 },728 {729 "startTime": "01:00",730 "endTime": "02:00",731 "day": "Saturday"732 },733 {734 "startTime": "02:00",735 "endTime": "03:00",736 "day": "Saturday"737 },738 {739 "startTime": "03:00",740 "endTime": "04:00",741 "day": "Saturday"742 },743 {744 "startTime": "04:00",745 "endTime": "05:00",746 "day": "Saturday"747 },748 {749 "startTime": "05:00",750 "endTime": "06:00",751 "day": "Saturday"752 },753 {754 "startTime": "06:00",755 "endTime": "07:00",756 "day": "Saturday"757 },758 {759 "startTime": "07:00",760 "endTime": "08:00",761 "day": "Saturday"762 },763 {764 "startTime": "08:00",765 "endTime": "09:00",766 "day": "Saturday"767 },768 {769 "startTime": "09:00",770 "endTime": "10:00",771 "day": "Saturday"772 },773 {774 "startTime": "10:00",775 "endTime": "11:00",776 "day": "Saturday"777 },778 {779 "startTime": "11:00",780 "endTime": "12:00",781 "day": "Saturday"782 },783 {784 "startTime": "12:00",785 "endTime": "13:00",786 "day": "Saturday"787 },788 {789 "startTime": "13:00",790 "endTime": "14:00",791 "day": "Saturday"792 },793 {794 "startTime": "14:00",795 "endTime": "15:00",796 "day": "Saturday"797 },798 {799 "startTime": "15:00",800 "endTime": "16:00",801 "day": "Saturday"802 },803 {804 "startTime": "16:00",805 "endTime": "17:00",806 "day": "Saturday"807 },808 {809 "startTime": "17:00",810 "endTime": "18:00",811 "day": "Saturday"812 },813 {814 "startTime": "18:00",815 "endTime": "19:00",816 "day": "Saturday"817 },818 {819 "startTime": "19:00",820 "endTime": "20:00",821 "day": "Saturday"822 },823 {824 "startTime": "20:00",825 "endTime": "21:00",826 "day": "Saturday"827 },828 {829 "startTime": "21:00",830 "endTime": "22:00",831 "day": "Saturday"832 },833 {834 "startTime": "22:00",835 "endTime": "23:00",836 "day": "Saturday"837 },838 {839 "startTime": "23:00",840 "endTime": "00:00",841 "day": "Saturday"842 },843 {844 "startTime": "00:00",845 "endTime": "01:00",846 "day": "Sunday"847 },848 {849 "startTime": "01:00",850 "endTime": "02:00",851 "day": "Sunday"852 },853 {854 "startTime": "02:00",855 "endTime": "03:00",856 "day": "Sunday"857 },858 {859 "startTime": "03:00",860 "endTime": "04:00",861 "day": "Sunday"862 },863 {864 "startTime": "04:00",865 "endTime": "05:00",866 "day": "Sunday"867 },868 {869 "startTime": "05:00",870 "endTime": "06:00",871 "day": "Sunday"872 },873 {874 "startTime": "06:00",875 "endTime": "07:00",876 "day": "Sunday"877 },878 {879 "startTime": "07:00",880 "endTime": "08:00",881 "day": "Sunday"882 },883 {884 "startTime": "08:00",885 "endTime": "09:00",886 "day": "Sunday"887 },888 {889 "startTime": "09:00",890 "endTime": "10:00",891 "day": "Sunday"892 },893 {894 "startTime": "10:00",895 "endTime": "11:00",896 "day": "Sunday"897 },898 {899 "startTime": "11:00",900 "endTime": "12:00",901 "day": "Sunday"902 },903 {904 "startTime": "12:00",905 "endTime": "13:00",906 "day": "Sunday"907 },908 {909 "startTime": "13:00",910 "endTime": "14:00",911 "day": "Sunday"912 },913 {914 "startTime": "14:00",915 "endTime": "15:00",916 "day": "Sunday"917 },918 {919 "startTime": "15:00",920 "endTime": "16:00",921 "day": "Sunday"922 },923 {924 "startTime": "16:00",925 "endTime": "17:00",926 "day": "Sunday"927 },928 {929 "startTime": "17:00",930 "endTime": "18:00",931 "day": "Sunday"932 },933 {934 "startTime": "18:00",935 "endTime": "19:00",936 "day": "Sunday"937 },938 {939 "startTime": "19:00",940 "endTime": "20:00",941 "day": "Sunday"942 },943 {944 "startTime": "20:00",945 "endTime": "21:00",946 "day": "Sunday"947 },948 {949 "startTime": "21:00",950 "endTime": "22:00",951 "day": "Sunday"952 },953 {954 "startTime": "22:00",955 "endTime": "23:00",956 "day": "Sunday"957 },958 {959 "startTime": "23:00",960 "endTime": "00:00",961 "day": "Sunday"962 }...
module3_情境_behavior27.js
Source:module3_情境_behavior27.js
1var data1 = [];2var data2 = [];3var data3 = [];4var data4 = [];5var categories = ['讲æè¨è¯åæ¢', '交äºç段', 'æ¿ä¹¦ç段'];6var type2color = {7 'A': '#2F4F4F',8 'B': '#FF1493',9 'C': '#00C5CD',10 'D': '#BDB76B',11 'E': '#FF8C69'12};13var tyep2name = {14 'A': '讲æè¨è¯åæ¢',15 'B': '交äºç段',16 'C': 'æ¿ä¹¦ç段'17};18var dataSource = [19// {name: 'B', startTime: 1709.21, endTime: 1736},20{name: 'B', startTime: 729.79, endTime: 809.12},21{name: 'B', startTime: 536.67, endTime: 555.46},22{name: 'B', startTime: 1207.75, endTime: 1279.12},23{name: 'B', startTime: 1621.49, endTime: 1728.59},24{name: 'B', startTime: 1897.09, endTime: 1923.82},25{name: 'B', startTime: 2324.66, endTime: 2421.54},26{name: 'B', startTime: 2434.93, endTime: 2508.89},27{name: 'B', startTime: 2525.92, endTime: 2583.22},28{name: 'B', startTime: 2593.08, endTime: 2664.06},29 {name: 'C', startTime: 365, endTime: 373},30 {name: 'C', startTime: 1398, endTime: 1410},31{name: 'D', startTime: 122.75, endTime: 137.6},32{name: 'D', startTime: 536.67, endTime: 546.82},33{name: 'D', startTime: 734.54, endTime: 747.41},34{name: 'D', startTime: 752.85, endTime: 756.12},35{name: 'D', startTime: 772.0, endTime: 778.75},36{name: 'D', startTime: 792.65, endTime: 799.52},37{name: 'D', startTime: 911.28, endTime: 918.94},38{name: 'D', startTime: 1219.34, endTime: 1248.86},39{name: 'D', startTime: 1248.87, endTime: 1269.75},40{name: 'D', startTime: 1626.44, endTime: 1635.58},41{name: 'D', startTime: 1651.41, endTime: 1662.21},42{name: 'D', startTime: 1673.42, endTime: 1694.81},43{name: 'D', startTime: 1694.82, endTime: 1697.09},44{name: 'D', startTime: 1697.23, endTime: 1702.9},45{name: 'D', startTime: 1708.51, endTime: 1719.4},46{name: 'D', startTime: 1897.09, endTime: 1903.48},47{name: 'D', startTime: 1907.68, endTime: 1911.4},48{name: 'D', startTime: 1914.28, endTime: 1918.59},49{name: 'D', startTime: 2324.66, endTime: 2350.77},50{name: 'D', startTime: 2351.39, endTime: 2355.08},51{name: 'D', startTime: 2355.09, endTime: 2358.56},52{name: 'D', startTime: 2358.87, endTime: 2360.91},53{name: 'D', startTime: 2360.92, endTime: 2373.68},54{name: 'D', startTime: 2373.69, endTime: 2377.85},55{name: 'D', startTime: 2377.86, endTime: 2386.82},56{name: 'D', startTime: 2388.67, endTime: 2395.58},57{name: 'D', startTime: 2395.59, endTime: 2406.84},58{name: 'D', startTime: 2406.92, endTime: 2421.54},59{name: 'D', startTime: 2434.93, endTime: 2450.54},60{name: 'D', startTime: 2450.75, endTime: 2474.38},61{name: 'D', startTime: 2474.39, endTime: 2476.78},62{name: 'D', startTime: 2476.79, endTime: 2481.02},63{name: 'D', startTime: 2481.03, endTime: 2492.19},64{name: 'D', startTime: 2492.2, endTime: 2508.89},65{name: 'D', startTime: 2525.92, endTime: 2530.91},66{name: 'D', startTime: 2530.92, endTime: 2537.27},67{name: 'D', startTime: 2537.28, endTime: 2547.04},68{name: 'D', startTime: 2547.05, endTime: 2551.16},69{name: 'D', startTime: 2551.17, endTime: 2557.44},70{name: 'D', startTime: 2557.98, endTime: 2561.49},71{name: 'D', startTime: 2561.69, endTime: 2564.36},72{name: 'D', startTime: 2564.37, endTime: 2583.22},73{name: 'D', startTime: 2593.08, endTime: 2597.68},74{name: 'D', startTime: 2598.21, endTime: 2601.0},75{name: 'D', startTime: 2601.54, endTime: 2610.89},76{name: 'D', startTime: 2610.9, endTime: 2628.72},77{name: 'D', startTime: 2629.57, endTime: 2633.4},78{name: 'D', startTime: 2633.41, endTime: 2636.24},79{name: 'D', startTime: 2639.7, endTime: 2644.4},80{name: 'D', startTime: 2644.41, endTime: 2650.15},81{name: 'D', startTime: 2651.09, endTime: 2664.06},82{name: 'E', startTime: 31.05, endTime: 40.55},83{name: 'E', startTime: 41.64, endTime: 47.81},84{name: 'E', startTime: 83.1, endTime: 91.41},85{name: 'E', startTime: 208.44, endTime: 231.32},86{name: 'E', startTime: 256.41, endTime: 259.12},87{name: 'E', startTime: 290.79, endTime: 301.99},88{name: 'E', startTime: 334.7, endTime: 356.78},89{name: 'E', startTime: 422.29, endTime: 424.82},90{name: 'E', startTime: 441.27, endTime: 456.41},91{name: 'E', startTime: 506.89, endTime: 514.27},92{name: 'E', startTime: 546.98, endTime: 555.46},93{name: 'E', startTime: 574.56, endTime: 581.28},94{name: 'E', startTime: 581.29, endTime: 586.97},95{name: 'E', startTime: 631.77, endTime: 638.67},96{name: 'E', startTime: 638.68, endTime: 642.95},97{name: 'E', startTime: 682.91, endTime: 691.49},98{name: 'E', startTime: 720.75, endTime: 729.78},99{name: 'E', startTime: 729.79, endTime: 734.53},100{name: 'E', startTime: 748.89, endTime: 752.84},101{name: 'E', startTime: 757.93, endTime: 767.91},102{name: 'E', startTime: 769.09, endTime: 771.68},103{name: 'E', startTime: 778.76, endTime: 792.57},104{name: 'E', startTime: 801.19, endTime: 809.12},105{name: 'E', startTime: 850.19, endTime: 854.86},106{name: 'E', startTime: 855.05, endTime: 860.44},107{name: 'E', startTime: 885.6, endTime: 896.51},108{name: 'E', startTime: 924.11, endTime: 933.23},109{name: 'E', startTime: 956.9, endTime: 969.36},110{name: 'E', startTime: 969.37, endTime: 976.46},111{name: 'E', startTime: 1048.98, endTime: 1051.53},112{name: 'E', startTime: 1051.54, endTime: 1059.17},113{name: 'E', startTime: 1104.34, endTime: 1109.24},114{name: 'E', startTime: 1155.78, endTime: 1161.34},115{name: 'E', startTime: 1162.18, endTime: 1168.83},116{name: 'E', startTime: 1194.42, endTime: 1200.78},117{name: 'E', startTime: 1207.75, endTime: 1216.36},118{name: 'E', startTime: 1216.5, endTime: 1218.61},119{name: 'E', startTime: 1269.89, endTime: 1279.12},120{name: 'E', startTime: 1279.13, endTime: 1297.55},121{name: 'E', startTime: 1318.65, endTime: 1335.1},122{name: 'E', startTime: 1374.19, endTime: 1388.15},123{name: 'E', startTime: 1485.01, endTime: 1491.52},124{name: 'E', startTime: 1494.3, endTime: 1511.25},125{name: 'E', startTime: 1534.24, endTime: 1548.11},126{name: 'E', startTime: 1575.64, endTime: 1590.38},127{name: 'E', startTime: 1621.49, endTime: 1626.31},128{name: 'E', startTime: 1635.59, endTime: 1648.32},129{name: 'E', startTime: 1648.33, endTime: 1651.4},130{name: 'E', startTime: 1663.32, endTime: 1667.78},131{name: 'E', startTime: 1670.52, endTime: 1673.41},132{name: 'E', startTime: 1703.04, endTime: 1708.25},133{name: 'E', startTime: 1719.41, endTime: 1721.44},134{name: 'E', startTime: 1721.48, endTime: 1728.59},135{name: 'E', startTime: 1748.48, endTime: 1754.23},136{name: 'E', startTime: 1785.85, endTime: 1817.63},137{name: 'E', startTime: 1833.21, endTime: 1841.47},138{name: 'E', startTime: 1858.04, endTime: 1875.5},139{name: 'E', startTime: 1886.46, endTime: 1891.47},140{name: 'E', startTime: 1897.09, endTime: 1903.48},141{name: 'E', startTime: 1903.49, endTime: 1907.55},142{name: 'E', startTime: 1907.68, endTime: 1911.4},143{name: 'E', startTime: 1914.28, endTime: 1918.59},144{name: 'E', startTime: 1918.73, endTime: 1923.82},145{name: 'E', startTime: 1966.58, endTime: 1981.56},146{name: 'E', startTime: 2054.92, endTime: 2066.22},147{name: 'E', startTime: 2125.92, endTime: 2128.27},148{name: 'E', startTime: 2158.54, endTime: 2162.81},149{name: 'E', startTime: 2181.24, endTime: 2204.31},150{name: 'E', startTime: 2236.1, endTime: 2246.92},151{name: 'E', startTime: 2246.93, endTime: 2254.65},152{name: 'E', startTime: 2287.16, endTime: 2308.37},153{name: 'E', startTime: 2324.66, endTime: 2350.77},154{name: 'E', startTime: 2351.39, endTime: 2355.08},155{name: 'E', startTime: 2355.09, endTime: 2358.56},156{name: 'E', startTime: 2358.87, endTime: 2360.91},157{name: 'E', startTime: 2360.92, endTime: 2373.68},158{name: 'E', startTime: 2373.69, endTime: 2377.85},159{name: 'E', startTime: 2377.86, endTime: 2386.82},160{name: 'E', startTime: 2388.67, endTime: 2395.58},161{name: 'E', startTime: 2395.59, endTime: 2406.84},162{name: 'E', startTime: 2406.92, endTime: 2421.54},163{name: 'E', startTime: 2434.93, endTime: 2450.54},164{name: 'E', startTime: 2450.75, endTime: 2474.38},165{name: 'E', startTime: 2474.39, endTime: 2476.78},166{name: 'E', startTime: 2476.79, endTime: 2481.02},167{name: 'E', startTime: 2481.03, endTime: 2492.19},168{name: 'E', startTime: 2492.2, endTime: 2508.89},169{name: 'E', startTime: 2525.92, endTime: 2530.91},170{name: 'E', startTime: 2530.92, endTime: 2537.27},171{name: 'E', startTime: 2537.28, endTime: 2547.04},172{name: 'E', startTime: 2547.05, endTime: 2551.16},173{name: 'E', startTime: 2551.17, endTime: 2557.44},174{name: 'E', startTime: 2557.98, endTime: 2561.49},175{name: 'E', startTime: 2561.69, endTime: 2564.36},176{name: 'E', startTime: 2564.37, endTime: 2583.22},177{name: 'E', startTime: 2593.08, endTime: 2597.68},178{name: 'E', startTime: 2598.21, endTime: 2601.0},179{name: 'E', startTime: 2601.54, endTime: 2610.89},180{name: 'E', startTime: 2610.9, endTime: 2628.72},181{name: 'E', startTime: 2629.57, endTime: 2633.4},182{name: 'E', startTime: 2633.41, endTime: 2636.24},183{name: 'E', startTime: 2639.7, endTime: 2644.4},184{name: 'E', startTime: 2644.41, endTime: 2650.15},185{name: 'E', startTime: 2651.09, endTime: 2664.06},186{name: 'E', startTime: 2664.07, endTime: 2669.34},187{name: 'E', startTime: 2683.95, endTime: 2704.43},188{name: 'E', startTime: 2717.32, endTime: 2718.39},189 {name: 'A', startTime: 136, endTime: 149},190 {name: 'A', startTime: 150, endTime: 171},191{name: 'A', startTime: 172, endTime: 179},192{name: 'A', startTime: 546, endTime: 564},193{name: 'A', startTime: 709, endTime: 717},194{name: 'A', startTime: 1036, endTime: 1052},195{name: 'A', startTime: 1053, endTime: 1061},196{name: 'A', startTime: 1461, endTime: 1472},197{name: 'A', startTime: 1701, endTime: 1717},198{name: 'A', startTime: 2203, endTime: 2219},199];200var board = 0;201var talk = 0;202for (var i = 0; i < dataSource.length; i++) {203 if (dataSource[i].name == 'A') {204 data1.push({205 name: tyep2name[dataSource[i].name],206 value: [0, dataSource[i].startTime, dataSource[i].endTime, dataSource[i].endTime - dataSource[i].startTime],207 itemStyle: {normal: {color: type2color[dataSource[i].name]}}208 })209 } else if (dataSource[i].name == 'B') {210 talk = talk + dataSource[i].endTime - dataSource[i].startTime;211 data2.push({212 name: tyep2name[dataSource[i].name],213 value: [3, dataSource[i].startTime, dataSource[i].endTime, dataSource[i].endTime - dataSource[i].startTime],214 itemStyle: {normal: {color: type2color[dataSource[i].name]}}215 })216 } else if (dataSource[i].name == 'C') {217 board = board + dataSource[i].endTime - dataSource[i].startTime;218 data3.push({219 name: tyep2name[dataSource[i].name],220 value: [4, dataSource[i].startTime, dataSource[i].endTime, dataSource[i].endTime - dataSource[i].startTime],221 itemStyle: {normal: {color: type2color[dataSource[i].name]}}222 })223 } else if (dataSource[i].name == 'D') {224 data4.push({225 name: tyep2name[dataSource[i].name],226 value: [1, dataSource[i].startTime+2, dataSource[i].endTime-2, dataSource[i].endTime - dataSource[i].startTime-4],227 itemStyle: {normal: {color: type2color[dataSource[i].name]}}228 })229 } else if (dataSource[i].name == 'E') {230 data4.push({231 name: tyep2name[dataSource[i].name],232 value: [2, dataSource[i].startTime+2, dataSource[i].endTime-2, dataSource[i].endTime - dataSource[i].startTime-4],233 itemStyle: {normal: {color: type2color[dataSource[i].name]}}234 })235 }236}237function changeTime(value) {238 let theTime = value;//ç§239 let middle = 0;//å240 let hour = 0;//å°æ¶241 if (theTime > 59) {242 middle = parseInt(theTime / 60);243 theTime = parseInt(theTime % 60);244 }245 if (middle > 59) {246 hour = parseInt(middle / 60);247 middle = parseInt(middle % 60);248 }249 theTime < 10 ? theTime = '0' + theTime : theTime = theTime250 middle < 10 ? middle = '0' + middle : middle = middle251 hour < 10 ? hour = '0' + hour : hour = hour252 return middle + ':' + theTime253}254function renderItem(params, api) {255 var categoryIndex = api.value(0);256 var start = api.coord([api.value(1), categoryIndex]);257 var end = api.coord([api.value(2), categoryIndex]);258 var height = api.size([0, 1])[1] * 0.6;259 var rectShape = echarts.graphic.clipRectByRect(260 {261 x: start[0],262 y: start[1] - height / 2,263 width: end[0] - start[0],264 height: height265 },266 {267 x: params.coordSys.x,268 y: params.coordSys.y,269 width: params.coordSys.width,270 height: params.coordSys.height271 }272 );273 return (274 rectShape && {275 type: 'rect',276 transition: ['shape'],277 shape: rectShape,278 style: api.style()279 }280 );281}282option = {283 tooltip: {284 formatter: function (params) {285 return params.marker + params.name + ': ' + changeTime(params.value[1]) 286 + '-' + changeTime(params.value[2]);287 }288 },289 toolbox: {290 feature: {saveAsImage: {pixelRatio: 2}}291 },292 // title: {293 // text: 'Profile',294 // left: 'center'295 // },296 dataZoom: [297 {298 type: 'slider',299 filterMode: 'weakFilter',300 showDataShadow: false,301 top: 400,302 labelFormatter: ''303 },304 {305 type: 'inside',306 filterMode: 'weakFilter'307 }308 ],309 grid: {310 left: 145,311 height: 250312 },313 xAxis: {314 min: 0,315 scale: true,316 max: 2718,317 name: 'è§é¢æ¶é´ï¼mm : ssï¼',318 nameLocation: 'center',319 nameGap: 33,320 nameTextStyle: {fontSize: 18},321 interval: 389,322 axisLabel: {323 formatter: function (val) {324 return changeTime(val);325 },326 fontSize: 17327 },328 axisLine: {329 show: true,330 lineStyle: {color: '#000000', width: 1}331 }332 },333 yAxis: {334 name: 'æå¦æ
å¢',335 nameLocation: 'end',336 nameGap: 15,337 nameTextStyle: {fontSize: 19, align: 'right'},338 data: [339 {value: '讲ææ
å¢åæ¢æ¶æ®µ', textStyle: {fontSize: 17, color: '#000000'}},340 {value: 'éæå¸è¨è¯', textStyle: {fontSize: 17, color: '#000000'}},341 {value: '交äºç±»è¨è¯', textStyle: {fontSize: 17, color: '#000000'}},342 {value: '交äºæ
å¢ç段', textStyle: {fontSize: 17, color: '#000000'}},343 {value: 'æ¿ä¹¦æ
å¢ç段', textStyle: {fontSize: 17, color: '#000000'}},344 // {value: board},345 // {value: talk}346 ],347 axisLabel: {margin: 5},348 axisLine: {lineStyle: {color: '#000000', width: 1.5}}349 },350 color: ['#7b9ce1', '#e0bc78', '#bd6d6c', '#75d874'],351 series: [352 {353 type: 'custom',354 name: tyep2name['A'],355 renderItem: renderItem,356 itemStyle: {357 opacity: 0.8358 },359 encode: {360 x: [1, 2],361 y: 0362 },363 data: data1364 },365 {366 type: 'custom',367 name: tyep2name['B'],368 renderItem: renderItem,369 itemStyle: {370 opacity: 0.8371 },372 encode: {373 x: [1, 2],374 y: 0375 },376 data: data2377 },378 {379 type: 'custom',380 name: tyep2name['C'],381 renderItem: renderItem,382 itemStyle: {383 opacity: 0.8384 },385 encode: {386 x: [1, 2],387 y: 0388 },389 data: data3390 },391 {392 type: 'custom',393 name: tyep2name['D'],394 renderItem: renderItem,395 itemStyle: {396 color: '#812990',397 opacity: 1398 },399 encode: {400 x: [1, 2],401 y: 0402 },403 data: data4,404 // markPoint: {405 // data : [406 // {name: 'A', coord: [464, 2], label: {show: true}},407 // {name: 'B', coord: [600, 2], label: {show: true}},408 // {name: 'C', coord: [1248, 2], label: {show: true}},409 // {name: 'D', coord: [1755, 2], label: {show: true}},410 // {name: 'E', coord: [2334, 2], label: {show: true}},411 // {name: 'F', coord: [2434, 2], label: {show: true}},412 // ],413 // symbol: 'circle',414 // symbolSize: 5,415 // // symbolRotate: 180,416 // // symbolOffset: [0, '-70%'],417 // itemStyle: {color: '#FF0000'},418 // label: {show: true, formatter: '{b}', fontSize: 16, color: '#FFFFFF',419 // textBorderColor: '#FF0000', textBorderWidth: 4,420 // fontWeight: 'bold', offset: [5, 15]},421 // },422 }423 ]...
2022年上班时间.js
Source:2022年上班时间.js
1const arr1 = [2 {date: '2022-01-03', startTime: '09:53', endtime: '18.08', week: 'å¨ä¸å
æ¦åæå ç' },3 {date: '2022-01-04', startTime: '08:37', endtime: '22.17', week: 'å¨äº' },4 {date: '2022-01-05', startTime: '09:23', endtime: '19.29', week: 'å¨ä¸' },5 {date: '2022-01-06', startTime: '08:43', endtime: '19.03', week: 'å¨å' },6 {date: '2022-01-07', startTime: '13:17', endtime: '19.22', week: 'å¨äº' },7 {date: '2022-01-08', startTime: '10:32', endtime: '20.36', week: 'å¨å
åæå ç' },8 {date: '2022-01-09', startTime: '10:24', endtime: '20.25', week: 'å¨æ¥åæå ç' },9 {date: '2022-01-10', startTime: '08:30', endtime: '22.10', week: 'å¨ä¸' },10 {date: '2022-01-11', startTime: '09:40', endtime: '22.11', week: 'å¨äº' },11 {date: '2022-01-12', startTime: '09:33', endtime: '19.41', week: 'å¨ä¸' },12 {date: '2022-01-13', startTime: '08:47', endtime: '22.15', week: 'å¨å' },13 {date: '2022-01-14', startTime: '09:43', endtime: '19.06', week: 'å¨äº' },14 {date: '2022-01-15', startTime: '09:17', endtime: '21.36', week: 'å¨å
åæå ç' },15 {date: '2022-01-16', startTime: '12:18', endtime: '22.47', week: 'å¨æ¥åæå ç' },16 {date: '2022-01-17', startTime: '08:47', endtime: '22.55', week: 'å¨ä¸' },17 {date: '2022-01-18', startTime: '11:55', endtime: '22.33', week: 'å¨äº' },18 {date: '2022-01-19', startTime: '09:35', endtime: 'åæ¨08.47', week: 'å¨ä¸' },19 {date: '2022-01-20', startTime: '08:39', endtime: 'åæ¨01.19', week: 'å¨å' },20 {date: '2022-01-21', startTime: '09:38', endtime: '18.06', week: 'å¨äº' },21 {date: '2022-01-25', startTime: '08:20', endtime: '19.47', week: 'å¨äº' },22 {date: '2022-01-26', startTime: '08:33', endtime: '22.02', week: 'å¨ä¸' },23 {date: '2022-01-27', startTime: '12:10', endtime: '18.38', week: 'å¨å' },24 {date: '2022-01-28', startTime: '08:24', endtime: '18.01', week: 'å¨äº' },25]26const arr2 = [27 {date: '2022-02-08', startTime: '07:59', endtime: '19.21', week: 'å¨äº' },28 {date: '2022-02-09', startTime: '08:38', endtime: '19.41', week: 'å¨ä¸' },29 {date: '2022-02-10', startTime: '09:21', endtime: '22.05', week: 'å¨å' },30 {date: '2022-02-11', startTime: '09:35', endtime: '19.15', week: 'å¨äº' },31 {date: '2022-02-12', startTime: '10:44', endtime: '22.07', week: 'å¨å
åæå ç' },32 {date: '2022-02-13', startTime: '10:15', endtime: 'åæ¨01.21', week: 'å¨æ¥åæå ç' },33 {date: '2022-02-15', startTime: '08:24', endtime: '18.36', week: 'å¨äº' },34 {date: '2022-02-16', startTime: '08:49', endtime: '22.08', week: 'å¨ä¸' },35 {date: '2022-02-17', startTime: '09:22', endtime: '22.11', week: 'å¨å' },36 {date: '2022-02-18', startTime: '09:20', endtime: 'åæ¨06.04', week: 'å¨äº' },37 {date: '2022-02-22', startTime: '08:33', endtime: '19.20', week: 'å¨äº' },38 {date: '2022-02-23', startTime: '08:42', endtime: '22.07', week: 'å¨ä¸' },39 {date: '2022-02-24', startTime: '08:53', endtime: '22.01', week: 'å¨å' },40 {date: '2022-02-25', startTime: '09:41', endtime: '23.54', week: 'å¨äº' },41 {date: '2022-02-26', startTime: '11:17', endtime: '22.24', week: 'å¨å
åæå ç' },42 {date: '2022-02-27', startTime: '11:43', endtime: '22.24', week: 'å¨æ¥åæå ç' },43]44const arr4 = [45 {date: '2022-04-01', startTime: '08:38', endtime: '18.16', week: 'å¨äº' },46 {date: '2022-04-02', startTime: '08:27', endtime: '19.14', week: 'å¨å
åæè¡¥ç' },47 {date: '2022-04-05', startTime: '08:27', endtime: '21.45', week: 'æ¸
æå ç' },48 {date: '2022-04-06', startTime: '08:41', endtime: '22.03', week: 'å¨ä¸' },49 {date: '2022-04-07', startTime: '09:43', endtime: '22.06', week: 'å¨å' },50 {date: '2022-04-08', startTime: '09:51', endtime: '22.03', week: 'å¨äº' },51 {date: '2022-04-09', startTime: '09:55', endtime: '22.00', week: 'å¨å
åæå ç' },52 {date: '2022-04-11', startTime: '13:08', endtime: '19.00', week: 'å¨ä¸' },53 {date: '2022-04-12', startTime: '13:02', endtime: '22.58', week: 'å¨äº' },54 {date: '2022-04-13', startTime: '09:34', endtime: '22.00', week: 'å¨ä¸' },55 {date: '2022-04-14', startTime: '09:35', endtime: '22.25', week: 'å¨å' },56 {date: '2022-04-15', startTime: '09:48', endtime: '21.30', week: 'å¨äº' },57 {date: '2022-04-18', startTime: '08:48', endtime: '21.35', week: 'å¨ä¸' },58 {date: '2022-04-19', startTime: '13:17', endtime: '22.01', week: 'å¨äº' },59 {date: '2022-04-20', startTime: '09:39', endtime: '22.02', week: 'å¨ä¸' },60 {date: '2022-04-21', startTime: '09:46', endtime: '19.12', week: 'å¨å' },61 {date: '2022-04-22', startTime: '06:25', endtime: '18.04', week: 'å¨äº' },62 {date: '2022-04-23', startTime: '10:48', endtime: '18.59', week: 'å¨å
åæå ç' },63 {date: '2022-04-24', startTime: '08:44', endtime: '22.16', week: 'å¨æ¥åæè¡¥ç' },64 {date: '2022-04-25', startTime: '09:29', endtime: '22.06', week: 'å¨ä¸' },65 {date: '2022-04-26', startTime: '09:41', endtime: '22.16', week: 'å¨äº' },66 {date: '2022-04-27', startTime: '09:41', endtime: '18.15', week: 'å¨ä¸' },67 {date: '2022-04-28', startTime: '07:36', endtime: '22.07', week: 'å¨å' },68]69const arr5 = [70 {date: '2022-05-05', startTime: '08:51', endtime: '19.08', week: 'å¨å' },71 {date: '2022-05-06', startTime: '08:45', endtime: '19.31', week: 'å¨äº' },72 {date: '2022-05-07', startTime: '08:49', endtime: '20.33', week: 'å¨å
åæå ç' },73 {date: '2022-05-09', startTime: '13:21', endtime: '19.14', week: 'å¨ä¸' },74 {date: '2022-05-10', startTime: '12:38', endtime: '19.01', week: 'å¨äº' },75 {date: '2022-05-11', startTime: '08:33', endtime: '22.00', week: 'å¨ä¸' },76 {date: '2022-05-12', startTime: '09:43', endtime: '20.57', week: 'å¨å' },77 {date: '2022-05-13', startTime: '13:13', endtime: '19.31', week: 'å¨äº' },78 {date: '2022-05-16', startTime: '08:55', endtime: '22.01', week: 'å¨ä¸' },79 {date: '2022-05-17', startTime: '09:49', endtime: 'åæ¨00.03', week: 'å¨äº' },80 {date: '2022-05-18', startTime: '13:16', endtime: '18.16', week: 'å¨ä¸' },81 {date: '2022-05-19', startTime: '08:55', endtime: '18.12', week: 'å¨å' },82 {date: '2022-05-20', startTime: '08:59', endtime: '21.46', week: 'å¨äº' },83 {date: '2022-05-23', startTime: '08:52', endtime: '20.31', week: 'å¨ä¸' },84 {date: '2022-05-24', startTime: '08:58', endtime: '22.05', week: 'å¨äº' },85 {date: '2022-05-25', startTime: '09:38', endtime: '18.22', week: 'å¨ä¸' },86 {date: '2022-05-26', startTime: '08:40', endtime: '22.17', week: 'å¨å' },87 {date: '2022-05-27', startTime: '09:38', endtime: '20.00', week: 'å¨äº' },88 {date: '2022-05-29', startTime: '16:54', endtime: '21.18', week: 'å¨æ¥åæå ç' },89 {date: '2022-05-30', startTime: '08:51', endtime: '22.02', week: 'å¨ä¸' },90 {date: '2022-05-31', startTime: '09:42', endtime: '20.03', week: 'å¨äº' },91]92const arr6 = [93 {date: '2022-06-01', startTime: '01:00', endtime: '18.32', week: 'å¨ä¸' },94 {date: '2022-06-02', startTime: '08:24', endtime: '21.58', week: 'å¨å' },95 {date: '2022-06-06', startTime: '08:31', endtime: '22.02', week: 'å¨ä¸' },96 {date: '2022-06-07', startTime: '09:36', endtime: '20.09', week: 'å¨äº' },97 {date: '2022-06-08', startTime: '08:42', endtime: '22.05', week: 'å¨ä¸' },98 {date: '2022-06-09', startTime: '09:37', endtime: '20.28', week: 'å¨å' },99 {date: '2022-06-10', startTime: '08:45', endtime: '18.09', week: 'å¨äº' },100 {date: '2022-06-11', startTime: '15:39', endtime: '21.51', week: 'å¨å
åæå ç' },101 {date: '2022-06-12', startTime: '10:31', endtime: '21.44', week: 'å¨æ¥åæå ç' },102 {date: '2022-06-13', startTime: '08:45', endtime: '22.02', week: 'å¨ä¸' },103 {date: '2022-06-14', startTime: '09:47', endtime: '18.08', week: 'å¨äº' },104 {date: '2022-06-15', startTime: '08:43', endtime: '22.01', week: 'å¨ä¸' },105 {date: '2022-06-16', startTime: '09:37', endtime: '22.01', week: 'å¨å' },106 {date: '2022-06-17', startTime: '13:11', endtime: '19.42', week: 'å¨äº' },107 {date: '2022-06-19', startTime: '10:38', endtime: '23.06', week: 'å¨æ¥åæå ç' },108 {date: '2022-06-20', startTime: '09:23', endtime: 'åæ¨00.02', week: 'å¨ä¸' },109 {date: '2022-06-21', startTime: '09:35', endtime: '22.38', week: 'å¨äº' },110 {date: '2022-06-22', startTime: '13:08', endtime: '18.33', week: 'å¨ä¸' },111 {date: '2022-06-23', startTime: '08:40', endtime: '19.21', week: 'å¨å' },112 {date: '2022-06-24', startTime: '08:39', endtime: '21.38', week: 'å¨äº' },113 {date: '2022-06-26', startTime: '07:36', endtime: '20.43', week: 'å¨æ¥åæå ç' },114 {date: '2022-06-27', startTime: '08:40', endtime: '22.01', week: 'å¨ä¸' },115 {date: '2022-06-28', startTime: '09:33', endtime: '22.02', week: 'å¨äº' },116 {date: '2022-06-29', startTime: '09:35', endtime: '22.01', week: 'å¨ä¸' },117 {date: '2022-06-30', startTime: '09:36', endtime: '22.11', week: 'å¨å' },118]119const arr7 = [120 {date: '2022-07-01', startTime: '09:40', endtime: '21.30', week: 'å¨äº' },121 {date: '2022-07-04', startTime: '08:33', endtime: '22.02', week: 'å¨ä¸' },122 {date: '2022-07-05', startTime: '09:35', endtime: 'åæ¨02.02', week: 'å¨äº' },123 {date: '2022-07-07', startTime: '08:20', endtime: '19.01', week: 'å¨å' },124 {date: '2022-07-08', startTime: '08:43', endtime: '19.40', week: 'å¨äº' },125 {date: '2022-07-11', startTime: '08:31', endtime: '22.05', week: 'å¨ä¸' },126 {date: '2022-07-12', startTime: '09:30', endtime: '19.25', week: 'å¨äº' },127 {date: '2022-07-13', startTime: '19:59', endtime: '19.25', week: 'å¨ä¸' },128 {date: '2022-07-14', startTime: '13:02', endtime: '22.01', week: 'å¨å' },129 {date: '2022-07-15', startTime: '09:30', endtime: '21.31', week: 'å¨äº' },130 {date: '2022-07-18', startTime: '08:35', endtime: '22.03', week: 'å¨ä¸' },131 {date: '2022-07-19', startTime: '09:43', endtime: '22.01', week: 'å¨äº' },132 {date: '2022-07-20', startTime: '09:29', endtime: '22.02', week: 'å¨ä¸' },133 {date: '2022-07-21', startTime: '09:30', endtime: 'åæ¨00.30', week: 'å¨å' },134 {date: '2022-07-22', startTime: '09:29', endtime: '18.08', week: 'å¨äº' },135 {date: '2022-07-23', startTime: '08:36', endtime: '19.38', week: 'å¨å
åæå ç' },136 {date: '2022-07-24', startTime: '05:16', endtime: '19.38', week: 'å¨æ¥åæå ç' },137 {date: '2022-07-25', startTime: '08:31', endtime: 'åæ¨00.04', week: 'å¨ä¸' },138 {date: '2022-07-26', startTime: '09:35', endtime: '22.04', week: 'å¨äº' },139 {date: '2022-07-27', startTime: '09:24', endtime: '22.02', week: 'å¨ä¸' },140 {date: '2022-07-28', startTime: '09:38', endtime: 'åæ¨03.22', week: 'å¨å' },141]142function workOvertime(arr) {143 let sum = 0;144 let sum1 = 0;145 arr.forEach(item => {146 if(item.endtime.includes('22.')) {147 sum++148 }149 if(item.week.includes('å ç')) {150 sum1++151 }152 })153 console.log(`22ç¹ä»¥åä¸çç天æ°ä¸º${sum}天`);154 console.log(`å¨æ«å çç天æ°ä¸º${sum1}天`);155}...
melodies.js
Source:melodies.js
1const TWINKLE_TWINKLE = {2 ticksPerQuarter: 220,3 totalTime: 8,4 timeSignatures: [5 {6 time: 0,7 numerator: 4,8 denominator: 49 }10 ],11 tempos: [12 {13 time: 0,14 qpm: 12015 }16 ],17 notes: [18 { pitch: 60, startTime: 0.0, endTime: 0.5 },19 { pitch: 60, startTime: 0.5, endTime: 1.0 },20 { pitch: 67, startTime: 1.0, endTime: 1.5 },21 { pitch: 67, startTime: 1.5, endTime: 2.0 },22 { pitch: 69, startTime: 2.0, endTime: 2.5 },23 { pitch: 69, startTime: 2.5, endTime: 3.0 },24 { pitch: 67, startTime: 3.0, endTime: 4.0 },25 { pitch: 65, startTime: 4.0, endTime: 4.5 },26 { pitch: 65, startTime: 4.5, endTime: 5.0 },27 { pitch: 64, startTime: 5.0, endTime: 5.5 },28 { pitch: 64, startTime: 5.5, endTime: 6.0 },29 { pitch: 62, startTime: 6.0, endTime: 6.5 },30 { pitch: 62, startTime: 6.5, endTime: 7.0 },31 { pitch: 60, startTime: 7.0, endTime: 8.0 },32 ],33}34const TWINKLE_HALF = {35 ticksPerQuarter: 220,36 totalTime: 4,37 timeSignatures: [38 {39 time: 0,40 numerator: 4,41 denominator: 442 }43 ],44 tempos: [45 {46 time: 0,47 qpm: 12048 }49 ],50 notes: [51 { pitch: 60, startTime: 0.0, endTime: 0.5 },52 { pitch: 60, startTime: 0.5, endTime: 1.0 },53 { pitch: 67, startTime: 1.0, endTime: 1.5 },54 { pitch: 67, startTime: 1.5, endTime: 2.0 },55 { pitch: 69, startTime: 2.0, endTime: 2.5 },56 { pitch: 69, startTime: 2.5, endTime: 3.0 },57 { pitch: 67, startTime: 3.0, endTime: 4.0 },58 ],59}60const SOPHISTICATED_LADY = {61 ticksPerQuarter: 220,62 totalTime: 28.5,63 timeSignatures: [64 {65 time: 0,66 numerator: 4,67 denominator: 468 }69 ],70 tempos: [71 {72 time: 0,73 qpm: 12074 }75 ],76 notes: [77 { pitch: 66, startTime: 0, endTime: 1 },78 { pitch: 65, startTime: 1, endTime: 3.5 },79 { pitch: 68, startTime: 3.5, endTime: 4 },80 { pitch: 72, startTime: 4, endTime: 4.5 },81 { pitch: 75, startTime: 4.5, endTime: 5 },82 { pitch: 78, startTime: 5, endTime: 6 },83 { pitch: 77, startTime: 6, endTime: 7 },84 { pitch: 76, startTime: 7, endTime: 8 },85 { pitch: 75, startTime: 8, endTime: 8.5 },86 { pitch: 72, startTime: 8.5, endTime: 9 },87 { pitch: 67, startTime: 9, endTime: 11.5 },88 { pitch: 65, startTime: 11.5, endTime: 12 },89 { pitch: 68, startTime: 12, endTime: 12.5 },90 { pitch: 72, startTime: 12.5, endTime: 13 },91 { pitch: 75, startTime: 13, endTime: 14 },92 { pitch: 74, startTime: 14, endTime: 15 },93 { pitch: 73, startTime: 15, endTime: 16 },94 { pitch: 72, startTime: 16, endTime: 16.5 },95 { pitch: 77, startTime: 16.5, endTime: 17 },96 { pitch: 65, startTime: 17, endTime: 19.5 },97 { pitch: 67, startTime: 19.5, endTime: 20 },98 { pitch: 68, startTime: 20, endTime: 20.5 },99 { pitch: 72, startTime: 20.5, endTime: 21 },100 { pitch: 75, startTime: 21, endTime: 21.5 },101 { pitch: 72, startTime: 21.5, endTime: 22 },102 { pitch: 75, startTime: 22, endTime: 22.5 },103 { pitch: 72, startTime: 22.5, endTime: 24.5 },104 { pitch: 75, startTime: 24.5, endTime: 25.5 },105 { pitch: 67, startTime: 25.5, endTime: 28.5 }106 ]...
Using AI Code Generation
1var wpt = require('webpagetest');2var webPageTest = new wpt('API_KEY');3 if (err) {4 console.log(err);5 } else {6 webPageTest.getTestResults(data.data.testId, function(err, data) {7 if (err) {8 console.log(err);9 } else {10 console.log(data.data.average.firstView.endTime);11 }12 });13 }14});15var wpt = require('webpagetest');16var webPageTest = new wpt('API_KEY');17 if (err) {18 console.log(err);19 } else {20 webPageTest.getTestResults(data.data.testId, function(err, data) {21 if (err) {22 console.log(err);23 } else {24 console.log(data.data.average.firstView);25 }26 });27 }28});29var wpt = require('webpagetest');30var webPageTest = new wpt('API_KEY');31 if (err) {32 console.log(err);33 } else {34 webPageTest.getTestResults(data.data.testId, function(err, data) {35 if (err) {36 console.log(err);37 } else {38 console.log(data.data.average.firstView);39 }40 });41 }42});43var wpt = require('webpagetest');44var webPageTest = new wpt('API_KEY');45 if (err) {46 console.log(err);47 } else {48 webPageTest.getTestResults(data.data.testId, function(err, data) {49 if (err) {50 console.log(err);51 } else {52 console.log(data.data.average.firstView);53 }54 });55 }56});
Using AI Code Generation
1var wpt = require('webpagetest');2var options = {3};4var wpt = new WebPageTest('www.webpagetest.org', options.key);5wpt.runTest(testURL, function(err, data) {6 if (err) return console.error(err);7 wpt.getTestResults(data.data.testId, function(err, data) {8 if (err) return console.error(err);9 console.log(data.data.testId + ': ' + data.data.statusText);10 });11});12### runTest(url, options, callback)13 * `runs` - Number of test runs to average (default: 3)14 * `firstViewOnly` - Only test the first view (default: false)15 * `location` - Location to test from (default: Dulles:Chrome)16 * `connectivity` - Emulated connection speed (default: Cable)17 * `bwDown` - Emulated download bandwidth (default: 2000)18 * `bwUp` - Emulated upload bandwidth (default: 1000)19 * `latency` - Emulated latency (default: 28)20 * `plr` - Emulated packet loss rate (default: 0)21 * `mobile` - Emulate a mobile device (default: 0)22 * `video` - Capture video (default: 1)23 * `pollResults` - Poll for test results (default: 0)24 * `timeout` - Timeout for the test (default: 30000)25 * `web10` - Enable Web10 testing (default: 0)26 * `timeline` - Enable timeline collection (default: 0)27 * `timelineStacks` - Enable timeline stack collection (default: 0)28 * `timelineCallStacks` - Enable timeline call stack collection (default: 0)29 * `timelineMarkers` - Enable timeline marker collection (default: 0)
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3var location = 'Dulles:Chrome';4var options = {5};6wpt.runTest(url, options, function(err, data) {7 if (err) {8 return console.error('Error: ' + err);9 }10 console.log('Test status check at %s', data.data.testUrl);11 wpt.getTestResults(data.data.testId, function(err, data) {12 if (err) {13 return console.error('Error: ' + err);14 }15 console.log('Test status: ' + data.data.statusText);16 console.log('Test completed in %s seconds', data.data.average.firstView.endTime);17 });18});19var wpt = require('webpagetest');20var wpt = new WebPageTest('www.webpagetest.org');21var location = 'Dulles:Chrome';22var options = {23};24wpt.runTest(url, options, function(err, data) {25 if (err) {26 return console.error('Error: ' + err);27 }28 console.log('Test status check at %s', data.data.testUrl);29 wpt.getTestResults(data.data.testId, function(err, data) {30 if (err) {31 return console.error('Error: ' + err);32 }33 console.log('Test status: ' + data.data.statusText);34 console.log('Test completed in %s seconds', data.data.average.firstView.endTime);35 });36});37var wpt = require('webpagetest');38var wpt = new WebPageTest('www.webpagetest.org');39var location = 'Dulles:Chrome';40var options = {41};42wpt.runTest(url, options, function(err, data) {43 if (err
Using AI Code Generation
1wpt.endTime(function (err, data) {2 if (err) {3 console.log(err);4 } else {5 console.log(data);6 }7});8wpt.firstByte(function (err, data) {9 if (err) {10 console.log(err);11 } else {12 console.log(data);13 }14});15wpt.fullyLoaded(function (err, data) {16 if (err) {17 console.log(err);18 } else {19 console.log(data);20 }21});22wpt.loadTime(function (err, data) {23 if (err) {24 console.log(err);25 } else {26 console.log(data);27 }28});29wpt.pageLoadTime(function (err, data) {30 if (err) {31 console.log(err);32 } else {33 console.log(data);34 }35});36wpt.render(function (err, data) {37 if (err) {38 console.log(err);39 } else {40 console.log(data);41 }42});
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3var testId = '140331_2Q_3c0';4wpt.getTestResults(testId, function(err, data) {5 if (err) {6 console.log(err);7 } else {8 console.log(data.data.median.firstView.endTime);9 }10});11var wpt = require('webpagetest');12var wpt = new WebPageTest('www.webpagetest.org');13var testId = '140331_2Q_3c0';14wpt.getTestResults(testId, function(err, data) {15 if (err) {16 console.log(err);17 } else {18 console.log(data.data.median.firstView.endTime);19 }20});
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.getTestStatus('160711_6C_2e0e8a1c0a2f6e7d9c9f9d0f79b9a6a0', function(err, data) {4 console.log(data.data.testStatus);5});6#### getTestStatus(options, callback)7- `pollResults`: If set to true, the results will be polled until the test is complete (default is false)8- `pollResultsInterval`: The interval in milliseconds to poll the results (default is 5000)9- `timeout`: The timeout in milliseconds to wait for the test to complete (default is 300000)10- `requests`: The number of requests to poll the results (default is 60)11- `firstViewOnly`: If set to true, only the first view results will be returned (default is false)12- `video`: If set to true, a video of the test will be returned (default is false)
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.getTestStatus('170410_H4_2a9a8b0e1c6e7a6c8d6f8a6a4a6d7b6f', function(err, data) {4 if (err) return console.error(err);5 console.log('Test status: %j', data);6 console.log('Test end time: %s', data.data.completed);7});8var wpt = require('webpagetest');9var wpt = new WebPageTest('www.webpagetest.org');10wpt.getTestStatus('170410_H4_2a9a8b0e1c6e7a6c8d6f8a6a4a6d7b6f', function(err, data) {11 if (err) return console.error(err);12 console.log('Test status: %j', data);13 console.log('Test end time: %s', data.data.completed);14});15var wpt = require('webpagetest');16var wpt = new WebPageTest('www.webpagetest.org');17wpt.getTestStatus('170410_H4_2a9a8b0e1c6e7a6c8d6f8a6a4a6d7b6f', function(err, data) {18 if (err) return console.error(err);19 console.log('Test status: %j', data);20 console.log('Test end time: %s', data.data.completed);21});22var wpt = require('webpagetest');23var wpt = new WebPageTest('www.webpagetest.org');24wpt.getTestStatus('170410_H4_2a9a8b0e1c6e7a6c8d6f8a6a4a6d7b6f', function(err, data) {25 if (err) return console.error(err);26 console.log('Test status: %j', data);27 console.log('Test end time: %s', data.data.completed
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!