[
{
"id": "46bf11d5.5f89d",
"type": "tab",
"label": "Chart",
"disabled": false,
"info": ""
},
{
"id": "42c39222.3d0e5c",
"type": "tab",
"label": "Scoreboard",
"disabled": false,
"info": ""
},
{
"id": "60f52c2e.45c274",
"type": "tab",
"label": "Box score",
"disabled": false,
"info": ""
},
{
"id": "df6d0766.8da398",
"type": "tab",
"label": "Standings",
"disabled": false,
"info": ""
},
{
"id": "ab4c87ba.ff44c8",
"type": "tab",
"label": "Play-by-play",
"disabled": false,
"info": ""
},
{
"id": "f397e3c.e0ad52",
"type": "tab",
"label": "Lineups",
"disabled": false,
"info": ""
},
{
"id": "6a8799bb.b0d028",
"type": "tab",
"label": "Home",
"disabled": false,
"info": ""
},
{
"id": "8927ef63.a862e",
"type": "tab",
"label": "Main",
"disabled": false,
"info": ""
},
{
"id": "f4e919f2.939ed8",
"type": "reddit-credentials",
"z": "",
"username": "node_reddit_verified",
"user_agent": "Node red test",
"auth_type": "username_password",
"name": ""
},
{
"id": "737a4c38.4672c4",
"type": "reddit-credentials",
"z": "",
"username": "OSUcapstone",
"user_agent": "Overwriting comments",
"auth_type": "username_password",
"name": ""
},
{
"id": "89951c67.647f9",
"type": "ui_tab",
"z": "46bf11d5.5f89d",
"name": "FG3M",
"icon": "dashboard",
"order": 1
},
{
"id": "e74c505a.01d4d",
"type": "ui_group",
"z": "46bf11d5.5f89d",
"name": "Chart",
"tab": "8e292105.50c87",
"disp": false,
"width": "13",
"collapse": false
},
{
"id": "69aa4879.9749c8",
"type": "ui_group",
"z": "",
"name": "Chart",
"tab": "53e1940b.39239c",
"disp": false,
"width": "13",
"collapse": false
},
{
"id": "53e1940b.39239c",
"type": "ui_tab",
"z": "",
"name": "FG3M",
"icon": "dashboard",
"order": 1
},
{
"id": "10ecadf7.fb66c2",
"type": "ui_base",
"theme": {
"name": "theme-light",
"lightTheme": {
"default": "#0094CE",
"baseColor": "#0094CE",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"darkTheme": {
"default": "#097479",
"baseColor": "#097479",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": false
},
"customTheme": {
"name": "Untitled Theme 1",
"default": "#4B7930",
"baseColor": "#4B7930",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
},
"themeState": {
"base-color": {
"default": "#0094CE",
"value": "#0094CE",
"edited": false
},
"page-titlebar-backgroundColor": {
"value": "#0094CE",
"edited": false
},
"page-backgroundColor": {
"value": "#fafafa",
"edited": false
},
"page-sidebar-backgroundColor": {
"value": "#ffffff",
"edited": false
},
"group-textColor": {
"value": "#1bbfff",
"edited": false
},
"group-borderColor": {
"value": "#ffffff",
"edited": false
},
"group-backgroundColor": {
"value": "#ffffff",
"edited": false
},
"widget-textColor": {
"value": "#111111",
"edited": false
},
"widget-backgroundColor": {
"value": "#0094ce",
"edited": false
},
"widget-borderColor": {
"value": "#ffffff",
"edited": false
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
},
"angularTheme": {
"primary": "indigo",
"accents": "blue",
"warn": "red",
"background": "grey"
}
},
"site": {
"name": "Node-RED Dashboard",
"hideToolbar": "false",
"allowSwipe": "false",
"lockMenu": "false",
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
"sx": 48,
"sy": 48,
"gx": 6,
"gy": 6,
"cx": 6,
"cy": 6,
"px": 0,
"py": 0
}
}
},
{
"id": "6666f333.f6378c",
"type": "http in",
"z": "42c39222.3d0e5c",
"name": "",
"url": "/scoreboard",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 120,
"y": 80,
"wires": [
[
"df6d44ed.fc90a8"
]
]
},
{
"id": "637a5f2a.7ae64",
"type": "league",
"z": "42c39222.3d0e5c",
"name": "",
"league_type": "scoreboard",
"season": "2018-19",
"season_type": "Regular Season",
"game_date": "{{date}}",
"per_mode": "PerGame",
"player_team": "P",
"measure_type": "Base",
"ahead_behind": "Ahead or Behind",
"point_diff": 0,
"clutch_time": "Last 5 Minutes",
"group_quantity": "5",
"x": 530,
"y": 80,
"wires": [
[
"baceb97f.e96128"
]
]
},
{
"id": "baceb97f.e96128",
"type": "function",
"z": "42c39222.3d0e5c",
"name": "format response",
"func": "var scores = msg.payload.lineScore;\nvar header = msg.payload.gameHeader; \n\nvar response = [];\n\nheader.forEach((element, index, array) => {\n var home = scores.find(team => team.teamId === element.homeTeamId);\n var visitor = scores.find(team => team.teamId === element.visitorTeamId);\n var obj = {\n \"visitorIcon\": \"https://raw.githubusercontent.com/Arieg419/NBA_Scorecard/master/src/client/src/img/\" + visitor.teamAbbreviation + \".png\",\n \"visitorTeam\": visitor.teamAbbreviation,\n \"visitorPts\": visitor.pts,\n \"homeTeam\": home.teamAbbreviation, \n \"homePts\": home.pts,\n \"homeIcon\": \"https://raw.githubusercontent.com/Arieg419/NBA_Scorecard/master/src/client/src/img/\" + home.teamAbbreviation + \".png\",\n \"status\": element.gameStatusText,\n \"gameId\": element.gameId\n }\n response.push(obj);\n});\n\nmsg.script = \"scoreboard.js\";\nmsg.css = \"scoreboard.css\";\nmsg.payload = response; \n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 740,
"y": 80,
"wires": [
[
"9f92928c.ac9dc"
]
]
},
{
"id": "9f92928c.ac9dc",
"type": "template",
"z": "42c39222.3d0e5c",
"name": "HTML",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "
\n \n \n\n\n\n \n \n \n \n {{#payload}}\n \n  | \n {{visitorPts}} | \n \n {{status}}\n \n | \n {{homePts}} | \n  | \n
\n {{/payload}}\n \n
\n \n \n\n",
"output": "str",
"x": 910,
"y": 80,
"wires": [
[
"299c7d7a.248312"
]
]
},
{
"id": "1c27fa73.db5e16",
"type": "http in",
"z": "42c39222.3d0e5c",
"name": "",
"url": "/scoreboard",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 130,
"y": 160,
"wires": [
[
"eb416b6b.633688"
]
]
},
{
"id": "42c18583.a697bc",
"type": "http response",
"z": "42c39222.3d0e5c",
"name": "",
"statusCode": "",
"headers": {},
"x": 890,
"y": 160,
"wires": []
},
{
"id": "eb416b6b.633688",
"type": "league",
"z": "42c39222.3d0e5c",
"name": "",
"league_type": "scoreboard",
"season": "",
"season_type": "Regular Season",
"game_date": "{{req.body.date}}",
"per_mode": "PerGame",
"player_team": "P",
"measure_type": "Base",
"ahead_behind": "Ahead or Behind",
"point_diff": 0,
"clutch_time": "Last 5 Minutes",
"group_quantity": "5",
"x": 410,
"y": 160,
"wires": [
[
"e589696b.72fec8"
]
]
},
{
"id": "df6d44ed.fc90a8",
"type": "function",
"z": "42c39222.3d0e5c",
"name": "get today's date",
"func": "var tzoffset = (new Date()).getTimezoneOffset() * 60000; \nmsg.date = (new Date(Date.now() - tzoffset)).toISOString().slice(0, 10);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 320,
"y": 80,
"wires": [
[
"637a5f2a.7ae64"
]
]
},
{
"id": "19ae7e0c.f05b52",
"type": "http in",
"z": "42c39222.3d0e5c",
"name": "",
"url": "/public/scoreboard.js",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 150,
"y": 320,
"wires": [
[
"8f5744d.3e547b8"
]
]
},
{
"id": "3778b9dc.e9bc56",
"type": "http response",
"z": "42c39222.3d0e5c",
"name": "",
"statusCode": "",
"headers": {},
"x": 620,
"y": 320,
"wires": []
},
{
"id": "8f5744d.3e547b8",
"type": "template",
"z": "42c39222.3d0e5c",
"name": "javascript",
"field": "payload",
"fieldType": "msg",
"format": "javascript",
"syntax": "mustache",
"template": "async function updateDate(event) {\n event.preventDefault(); \n var date = document.getElementById(\"date\").value;\n var body = {\"date\": date};\n var response = await fetch(\"/scoreboard\", {\n \"method\": \"POST\", \n \"body\": JSON.stringify(body),\n \"headers\": {\"Content-Type\": \"application/json\"}\n })\n var data = await response.json()\n emptyTable(); \n addDataToTable(data);\n}\n\nfunction createIconImg(src) {\n var img = document.createElement(\"img\");\n img.src = src; \n img.className = \"icon\";\n return img; \n}\n\nfunction addDataToTable(data){\n var tbody = document.getElementById(\"tbody\");\n data.forEach((element, index, array) => {\n var row = tbody.insertRow(); \n var cell = row.insertCell(); \n var img = createIconImg(element.visitorIcon);\n cell.appendChild(img);\n \n cell = row.insertCell(); \n cell.innerText = element.visitorPts;\n \n cell = row.insertCell(); \n var a = document.createElement(\"a\");\n a.href = \"/boxscore/\" + element.gameId;\n a.innerText = element.status;\n cell.appendChild(a);\n \n cell = row.insertCell(); \n cell.innerText = element.homePts;\n \n cell = row.insertCell(); \n img = createIconImg(element.homeIcon)\n cell.appendChild(img);\n });\n}\n\nfunction removeChildren(elem) {\n while (elem.firstChild) {\n elem.removeChild(elem.firstChild);\n }\n}\n\nfunction emptyTable() {\n var tbody = document.getElementById(\"tbody\");\n removeChildren(tbody);\n}\n",
"output": "str",
"x": 420,
"y": 320,
"wires": [
[
"3778b9dc.e9bc56"
]
]
},
{
"id": "fffe5780.e70d48",
"type": "template",
"z": "42c39222.3d0e5c",
"name": "CSS",
"field": "payload",
"fieldType": "msg",
"format": "css",
"syntax": "mustache",
"template": ".icon {\n height: 7.5vh;\n width: auto;\n}\n\n#scoreboard {\n width:50%;\n margin: auto;\n}\n\n#date-form {\n width:50%;\n margin: auto auto 1rem auto;\n}",
"output": "str",
"x": 410,
"y": 380,
"wires": [
[
"ad63eb60.094368"
]
]
},
{
"id": "fd46ee14.9e25d",
"type": "http in",
"z": "42c39222.3d0e5c",
"name": "",
"url": "/public/scoreboard.css",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 150,
"y": 380,
"wires": [
[
"fffe5780.e70d48"
]
]
},
{
"id": "ad63eb60.094368",
"type": "http response",
"z": "42c39222.3d0e5c",
"name": "",
"statusCode": "",
"headers": {
"Content-Type": "text/css"
},
"x": 630,
"y": 380,
"wires": []
},
{
"id": "e589696b.72fec8",
"type": "function",
"z": "42c39222.3d0e5c",
"name": "format response",
"func": "var scores = msg.payload.lineScore;\nvar header = msg.payload.gameHeader; \n\nvar response = [];\n\nvar s = [];\n\nheader.forEach((element, index, array) => {\n var home = scores.find(team => team.teamId === element.homeTeamId);\n var visitor = scores.find(team => team.teamId === element.visitorTeamId);\n var obj = {\n \"visitorIcon\": \"https://raw.githubusercontent.com/Arieg419/NBA_Scorecard/master/src/client/src/img/\" + visitor.teamAbbreviation + \".png\",\n \"visitorTeam\": visitor.teamAbbreviation,\n \"visitorPts\": visitor.pts,\n \"homeTeam\": home.teamAbbreviation, \n \"homePts\": home.pts,\n \"homeIcon\": \"https://raw.githubusercontent.com/Arieg419/NBA_Scorecard/master/src/client/src/img/\" + home.teamAbbreviation + \".png\",\n // Old NBA game statuses are not \"Final\" like they should be\n \"status\": (element.gameStatusText === \" \") ? \"Final\" : element.gameStatusText,\n \"gameId\": element.gameId\n }\n response.push(obj);\n});\n\nmsg.script = \"scoreboard.js\";\nmsg.css = \"scoreboard.css\";\nmsg.payload = response; \n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 680,
"y": 160,
"wires": [
[
"42c18583.a697bc"
]
]
},
{
"id": "ace44d9.003b0b",
"type": "http in",
"z": "60f52c2e.45c274",
"name": "",
"url": "/boxscore/:gameId",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 180,
"y": 80,
"wires": [
[
"b141d139.2d3d4"
]
]
},
{
"id": "b141d139.2d3d4",
"type": "game",
"z": "60f52c2e.45c274",
"name": "",
"game_id": "{{req.params.gameId}}",
"game_type": "box score",
"x": 440,
"y": 80,
"wires": [
[
"f85e5834.ac8938"
]
]
},
{
"id": "534d8bd2.313a24",
"type": "template",
"z": "60f52c2e.45c274",
"name": "HTML",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "\n \n \n\n\n\n\n \n \n {{payload.game_date}}
\n \n \n \n \n | {{payload.home_team}} | \n Min | \n FG | \n FT | \n 3PT | \n +/- | \n OR | \n Reb | \n A | \n Blk | \n Stl | \n TO | \n PF | \n Pts | \n
\n \n \n {{#payload.home_roster}}\n \n | {{PLAYER_NAME}} | \n {{MIN}} | \n {{FGM}}-{{FGA}} | \n {{FTM}}-{{FTA}} | \n {{FG3M}}-{{FG3A}} | \n {{PLUS_MINUS}} | \n {{OREB}} | \n {{REB}} | \n {{AST}} | \n {{BLK}} | \n {{STL}} | \n {{TO}} | \n {{PF}} | \n {{PTS}} | \n
\n {{/payload.home_roster}}\n \n \n \n | Totals | \n {{payload.home_totals.MIN}} | \n {{payload.home_totals.FGM}}-{{payload.home_totals.FGA}} | \n {{payload.home_totals.FTM}}-{{payload.home_totals.FTA}} | \n {{payload.home_totals.FG3M}}-{{payload.home_totals.FG3A}} | \n {{payload.home_totals.PLUS_MINUS}} | \n {{payload.home_totals.OREB}} | \n {{payload.home_totals.REB}} | \n {{payload.home_totals.AST}} | \n {{payload.home_totals.BLK}} | \n {{payload.home_totals.STL}} | \n {{payload.home_totals.TO}} | \n {{payload.home_totals.PF}} | \n {{payload.home_totals.PTS}} | \n
\n \n
\n \n \n \n \n | {{payload.visitor_team}} | \n Min | \n FG | \n FT | \n 3PT | \n +/- | \n OR | \n Reb | \n A | \n Blk | \n Stl | \n TO | \n PF | \n Pts | \n
\n \n \n {{#payload.visitor_roster}}\n \n | {{PLAYER_NAME}} | \n {{MIN}} | \n {{FGM}}-{{FGA}} | \n {{FTM}}-{{FTA}} | \n {{FG3M}}-{{FG3A}} | \n {{PLUS_MINUS}} | \n {{OREB}} | \n {{REB}} | \n {{AST}} | \n {{BLK}} | \n {{STL}} | \n {{TO}} | \n {{PF}} | \n {{PTS}} | \n
\n {{/payload.visitor_roster}}\n \n \n \n | Totals | \n {{payload.visitor_totals.MIN}} | \n {{payload.visitor_totals.FGM}}-{{payload.visitor_totals.FGA}} | \n {{payload.visitor_totals.FTM}}-{{payload.visitor_totals.FTA}} | \n {{payload.visitor_totals.FG3M}}-{{payload.visitor_totals.FG3A}} | \n {{payload.visitor_totals.PLUS_MINUS}} | \n {{payload.visitor_totals.OREB}} | \n {{payload.visitor_totals.REB}} | \n {{payload.visitor_totals.AST}} | \n {{payload.visitor_totals.BLK}} | \n {{payload.visitor_totals.STL}} | \n {{payload.visitor_totals.TO}} | \n {{payload.visitor_totals.PF}} | \n {{payload.visitor_totals.PTS}} | \n
\n \n
\n \n \n",
"output": "str",
"x": 850,
"y": 80,
"wires": [
[
"8d7e60d4.1b19f"
]
]
},
{
"id": "f85e5834.ac8938",
"type": "function",
"z": "60f52c2e.45c274",
"name": "format response",
"func": "var player_stats = msg.payload.playerStats;\nvar game_summary = msg.payload.gameSummary;\nvar team_stats = msg.payload.teamStats;\n\nvar home_roster = player_stats.filter((player => player.TEAM_ID === game_summary.HOME_TEAM_ID ));\nvar visitor_roster = player_stats.filter((player => player.TEAM_ID === game_summary.VISITOR_TEAM_ID ));\nvar home_totals = team_stats.filter((team => team.TEAM_ID === game_summary.HOME_TEAM_ID));\nvar visitor_totals = team_stats.filter((team => team.TEAM_ID === game_summary.VISITOR_TEAM_ID));\n\n\nmsg.script = \"boxscore.js\";\nmsg.css = \"boxscore.css\";\n\nmsg.payload = {\n \"home_roster\": home_roster,\n \"visitor_roster\": visitor_roster,\n \"home_totals\": home_totals[0],\n \"visitor_totals\": visitor_totals[0],\n \"home_team\": home_roster[0].TEAM_ABBREVIATION,\n \"visitor_team\": visitor_roster[0].TEAM_ABBREVIATION,\n \"game_date\": msg.payload.gameInfo.GAME_DATE\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 660,
"y": 80,
"wires": [
[
"534d8bd2.313a24"
]
]
},
{
"id": "8fe2f046.444b4",
"type": "http in",
"z": "60f52c2e.45c274",
"name": "",
"url": "/public/boxscore.js",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 180,
"y": 180,
"wires": [
[
"f473a25d.9b399"
]
]
},
{
"id": "f473a25d.9b399",
"type": "template",
"z": "60f52c2e.45c274",
"name": "javascript",
"field": "payload",
"fieldType": "msg",
"format": "javascript",
"syntax": "mustache",
"template": "function resetButton(id) {\n var button = document.getElementById(id);\n console.log(button);\n button.parentNode.className = \"btn btn-secondary\";\n button.removeAttribute(\"checked\");\n console.log(button);\n}\n\nfunction resetButtons() {\n resetButton(\"homeButton\");\n resetButton(\"visitorButton\");\n}\n\nfunction targetButton(button) {\n button.parentNode.className = \"btn btn-secondary active\";\n}\n\nfunction hideTable(id){\n var table = document.getElementById(id);\n table.style.display = \"none\";\n}\n\nfunction hideTables() {\n hideTable(\"home-table\");\n hideTable(\"visitor-table\");\n}\n\nfunction showTable(id) {\n var table = document.getElementById(id);\n table.style.display = \"table\";\n}\n\nfunction updateBoxScore(event) {\n event.preventDefault(); \n //resetButtons();\n hideTables(); \n //targetButton(event.target);\n if (event.target.id === \"homeButton\") {\n showTable(\"home-table\");\n } else {\n showTable(\"visitor-table\");\n }\n}\n\n// second\n\nasync function updateDate(event) {\n event.preventDefault(); \n var date = document.getElementById(\"date\").value;\n var body = {\"date\": date};\n var response = await fetch(\"/boxscore\", {\n \"method\": \"POST\", \n \"body\": JSON.stringify(body),\n \"headers\": {\"Content-Type\": \"application/json\"}\n })\n // var data = await response.json()\n // emptyTable(); \n // addDataToTable(data);\n}\n\n\n\n\n",
"output": "str",
"x": 440,
"y": 180,
"wires": [
[
"d645a15b.d357c"
]
]
},
{
"id": "d645a15b.d357c",
"type": "http response",
"z": "60f52c2e.45c274",
"name": "",
"statusCode": "",
"headers": {},
"x": 640,
"y": 180,
"wires": []
},
{
"id": "21bf7407.f10cdc",
"type": "template",
"z": "60f52c2e.45c274",
"name": "css",
"field": "payload",
"fieldType": "msg",
"format": "css",
"syntax": "mustache",
"template": ".box-score {\n width:75%;\n margin: auto;\n}\n\n.btn-secondary.focus, .btn-secondary:focus, .btn-secondary.focus, .btn-secondary:focus {\n outline: none;\n box-shadow: none;\n}\n\n#game-date {\n margin-right: 12.5%;\n margin-top: -2rem;\n}\n\n#visitor-table {\n display: none;\n}\n#box-score-buttons {\n margin: auto;\n width: 25%;\n margin: 2vh 0vh 2vh 0vh;\n}",
"output": "str",
"x": 430,
"y": 240,
"wires": [
[
"7ed6174.2ba40e8"
]
]
},
{
"id": "9fcb82d0.c28d7",
"type": "http in",
"z": "60f52c2e.45c274",
"name": "",
"url": "/public/boxscore.css",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 190,
"y": 240,
"wires": [
[
"21bf7407.f10cdc"
]
]
},
{
"id": "7ed6174.2ba40e8",
"type": "http response",
"z": "60f52c2e.45c274",
"name": "",
"statusCode": "",
"headers": {
"Content-Type": "text/css"
},
"x": 650,
"y": 240,
"wires": []
},
{
"id": "c75f0586.09e9d8",
"type": "league",
"z": "df6d0766.8da398",
"name": "",
"league_type": "standings",
"season": "2018-19",
"season_type": "Regular Season",
"game_date": "",
"per_mode": "PerGame",
"player_team": "P",
"measure_type": "Base",
"ahead_behind": "Ahead or Behind",
"point_diff": 0,
"clutch_time": "Last 5 Minutes",
"group_quantity": "5",
"pt_measure_type": "CatchShoot",
"x": 350,
"y": 60,
"wires": [
[
"d3c68339.238e8"
]
]
},
{
"id": "d3c68339.238e8",
"type": "function",
"z": "df6d0766.8da398",
"name": "format response",
"func": "var west_standings = msg.payload.cleanedData.filter(team => team.Conference === \"West\");\nvar east_standings = msg.payload.cleanedData.filter(team => team.Conference === \"East\");\n\nvar payload = {\n \"west_standings\": west_standings,\n \"east_standings\": east_standings\n}\n\nmsg.script = \"standings.js\";\nmsg.css = \"standings.css\";\n\nmsg.payload = payload;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 580,
"y": 60,
"wires": [
[
"7a4c1869.cef208"
]
]
},
{
"id": "9d2e2313.d2318",
"type": "http in",
"z": "df6d0766.8da398",
"name": "",
"url": "/standings",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 120,
"y": 60,
"wires": [
[
"c75f0586.09e9d8"
]
]
},
{
"id": "7a4c1869.cef208",
"type": "template",
"z": "df6d0766.8da398",
"name": "HTML",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "\n \n \n\n\n\n \n \n \n \n \n | Team | \n W | \n L | \n Pct | \n GB | \n Conf | \n Home | \n Away | \n L10 | \n Streak | \n
\n \n \n {{#payload.west_standings}}\n \n | {{TeamName}} | \n {{WINS}} | \n {{LOSSES}} | \n {{WinPCT}} | \n {{ConferenceGamesBack}} | \n {{ConferenceRecord}} | \n {{HOME}} | \n {{ROAD}} | \n {{L10}} | \n {{strCurrentStreak}} | \n
\n {{/payload.west_standings}}\n \n
\n \n \n \n \n | Team | \n W | \n L | \n Pct | \n GB | \n Conf | \n Home | \n Away | \n L10 | \n Streak | \n
\n \n \n {{#payload.east_standings}}\n \n | {{TeamName}} | \n {{WINS}} | \n {{LOSSES}} | \n {{WinPCT}} | \n {{ConferenceGamesBack}} | \n {{ConferenceRecord}} | \n {{HOME}} | \n {{ROAD}} | \n {{L10}} | \n {{strCurrentStreak}} | \n
\n {{/payload.east_standings}}\n \n
\n \n \n\n\n\n\n",
"output": "str",
"x": 790,
"y": 60,
"wires": [
[
"2ed77c64.aaa4d4"
]
]
},
{
"id": "3a4d4736.5fb558",
"type": "http in",
"z": "df6d0766.8da398",
"name": "",
"url": "/public/standings.js",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 140,
"y": 160,
"wires": [
[
"f57ed62c.0a5f78"
]
]
},
{
"id": "f57ed62c.0a5f78",
"type": "template",
"z": "df6d0766.8da398",
"name": "javascript",
"field": "payload",
"fieldType": "msg",
"format": "javascript",
"syntax": "mustache",
"template": "function resetButton(id) {\n var button = document.getElementById(id);\n button.parentNode.className = \"btn btn-secondary\";\n button.removeAttribute(\"checked\");\n}\n\nfunction resetButtons() {\n resetButton(\"eastButton\");\n resetButton(\"westButton\");\n}\n\nfunction targetButton(button) {\n console.log(button.parentNode);\n button.parentNode.className = \"btn btn-secondary active\";\n}\n\nfunction hideTable(id){\n var table = document.getElementById(id);\n table.style.display = \"none\";\n}\n\nfunction hideTables() {\n hideTable(\"west-table\");\n hideTable(\"east-table\");\n}\n\nfunction showTable(id) {\n var table = document.getElementById(id);\n table.style.display = \"table\";\n}\n\nfunction updateStandings(event) {\n event.preventDefault(); \n resetButtons();\n hideTables(); \n //targetButton(event.target);\n if (event.target.id === \"westButton\") {\n showTable(\"west-table\");\n } else {\n showTable(\"east-table\");\n }\n \n}\n",
"output": "str",
"x": 400,
"y": 160,
"wires": [
[
"95deacb6.44d56"
]
]
},
{
"id": "95deacb6.44d56",
"type": "http response",
"z": "df6d0766.8da398",
"name": "",
"statusCode": "",
"headers": {},
"x": 600,
"y": 160,
"wires": []
},
{
"id": "22a61084.ea0ec",
"type": "template",
"z": "df6d0766.8da398",
"name": "css",
"field": "payload",
"fieldType": "msg",
"format": "css",
"syntax": "mustache",
"template": ".standings {\n width: 75%;\n margin: auto;\n}\n\n.btn-secondary.focus, .btn-secondary:focus, .btn-secondary.focus, .btn-secondary:focus {\n outline: none;\n box-shadow: none;\n}\n\n#east-table {\n display: none;\n}\n#standings-buttons {\n margin: auto;\n width: 25%;\n margin: 2vh 0vh 2vh 0vh;\n}",
"output": "str",
"x": 390,
"y": 220,
"wires": [
[
"bce4c063.ea3bf"
]
]
},
{
"id": "ec0684b7.10bfd8",
"type": "http in",
"z": "df6d0766.8da398",
"name": "",
"url": "/public/standings.css",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 150,
"y": 220,
"wires": [
[
"22a61084.ea0ec"
]
]
},
{
"id": "bce4c063.ea3bf",
"type": "http response",
"z": "df6d0766.8da398",
"name": "",
"statusCode": "",
"headers": {
"Content-Type": "text/css"
},
"x": 610,
"y": 220,
"wires": []
},
{
"id": "b83724a3.905b68",
"type": "function",
"z": "ab4c87ba.ff44c8",
"name": "get play description",
"func": "msg.payload.playByPlay.forEach((element, index, array) => {\n element.description = element. homedescription || element.visitordescription || element.neutraldescription; \n})\n\nmsg.css = \"play-by-play.css\"\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 80,
"wires": [
[
"3fa4a833.08e638"
]
]
},
{
"id": "3fa4a833.08e638",
"type": "template",
"z": "ab4c87ba.ff44c8",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "\n \n \n\n\n \n \n \n \n | Period | \n Time | \n Score | \n Description | \n
\n \n \n {{#payload.playByPlay}}\n \n | {{period}} | \n {{wctimestring}} | \n {{score}} | \n {{description}} | \n
\n {{/payload.playByPlay}}\n \n
\n",
"output": "str",
"x": 820,
"y": 80,
"wires": [
[
"db56e500.e2fe08"
]
]
},
{
"id": "53e803a9.a3b1ec",
"type": "http in",
"z": "ab4c87ba.ff44c8",
"name": "",
"url": "/play-by-play/:gameId",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 150,
"y": 80,
"wires": [
[
"c45281a5.b29bf"
]
]
},
{
"id": "c45281a5.b29bf",
"type": "game",
"z": "ab4c87ba.ff44c8",
"name": "",
"game_id": "{{req.params.gameId}}",
"game_type": "play-by-play",
"x": 390,
"y": 80,
"wires": [
[
"b83724a3.905b68"
]
]
},
{
"id": "a048e042.97757",
"type": "template",
"z": "ab4c87ba.ff44c8",
"name": "css",
"field": "payload",
"fieldType": "msg",
"format": "css",
"syntax": "mustache",
"template": "#play-by-play {\n width:50%;\n margin: auto;\n}",
"output": "str",
"x": 390,
"y": 200,
"wires": [
[
"7889043b.607aec"
]
]
},
{
"id": "c5ad5743.a85ba8",
"type": "http in",
"z": "ab4c87ba.ff44c8",
"name": "",
"url": "/public/play-by-play.css",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 160,
"y": 200,
"wires": [
[
"a048e042.97757"
]
]
},
{
"id": "7889043b.607aec",
"type": "http response",
"z": "ab4c87ba.ff44c8",
"name": "",
"statusCode": "",
"headers": {
"Content-Type": "text/css"
},
"x": 610,
"y": 200,
"wires": []
},
{
"id": "73fbde55.3a406",
"type": "http in",
"z": "f397e3c.e0ad52",
"name": "",
"url": "/lineups",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 130,
"y": 80,
"wires": [
[
"897eebea.105058"
]
]
},
{
"id": "8e382557.1ebe18",
"type": "template",
"z": "f397e3c.e0ad52",
"name": "HTML",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "\n \n \n \n \n\n\n\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n | Group Name | \n Min | \n Net Rating | \n Off Rating | \n Def Rating | \n
\n \n \n \n
\n \n \n
\n \n \n\n\n\n\n\n\n",
"output": "str",
"x": 790,
"y": 80,
"wires": [
[
"97b73e05.6b7c1"
]
]
},
{
"id": "c3e1d47c.80c198",
"type": "http in",
"z": "f397e3c.e0ad52",
"name": "",
"url": "/lineups",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 130,
"y": 160,
"wires": [
[
"29b00376.a3530c"
]
]
},
{
"id": "639c3a5d.283f14",
"type": "http response",
"z": "f397e3c.e0ad52",
"name": "",
"statusCode": "",
"headers": {},
"x": 970,
"y": 160,
"wires": []
},
{
"id": "d31d44e6.eed878",
"type": "json",
"z": "f397e3c.e0ad52",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 770,
"y": 160,
"wires": [
[
"639c3a5d.283f14"
]
]
},
{
"id": "ff026a9f.079638",
"type": "http in",
"z": "f397e3c.e0ad52",
"name": "",
"url": "/players",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 130,
"y": 240,
"wires": [
[
"d86b5fdb.75915"
]
]
},
{
"id": "cacfd1cd.d7033",
"type": "team",
"z": "f397e3c.e0ad52",
"name": "",
"team_id": "{{payload.team_id}}",
"team_type": "lineups",
"season": "2018-19",
"season_type": "Regular Season",
"measure_type": "Advanced",
"per_mode": "PerGame",
"group_quantity": "dynamic",
"player_team": "P",
"x": 590,
"y": 240,
"wires": [
[
"ec3b27fd.5305e8"
]
]
},
{
"id": "d86b5fdb.75915",
"type": "function",
"z": "f397e3c.e0ad52",
"name": "prepare msg props",
"func": "msg.topic = msg.req.body.players;\nmsg.group_quantity = msg.req.body.group_quantity; \nmsg.measure_type = msg.req.body.measure_type;\nmsg.minutes = msg.req.body.minutes; \nmsg.season_type = msg.req.body.season_type;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 350,
"y": 240,
"wires": [
[
"cacfd1cd.d7033"
]
]
},
{
"id": "ec3b27fd.5305e8",
"type": "function",
"z": "f397e3c.e0ad52",
"name": "filter lineups",
"func": "function allThere(groupId) {\n var players = msg.topic; \n for (var i = 0; i < players.length; i++) {\n if (groupId.indexOf(players[i]) === -1){\n return false;\n }\n }\n return true; \n}\n\nvar lineup = [];\n\nfor (var i = 0; i < msg.payload.length; i++) {\n var groupId = msg.payload[i].groupId;\n if (allThere(groupId)) {\n lineup.push(msg.payload[i])\n }\n}\n\nmsg.payload = lineup; \n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 790,
"y": 240,
"wires": [
[
"9189154c.2165d8"
]
]
},
{
"id": "9189154c.2165d8",
"type": "http response",
"z": "f397e3c.e0ad52",
"name": "",
"statusCode": "",
"headers": {},
"x": 970,
"y": 240,
"wires": []
},
{
"id": "897eebea.105058",
"type": "database",
"z": "f397e3c.e0ad52",
"name": "",
"database_type": "get data",
"get_type": "all teams",
"first_name": "",
"last_name": "",
"team_name": "",
"source": "name",
"object_id": "",
"x": 390,
"y": 80,
"wires": [
[
"18f38642.1b060a"
]
]
},
{
"id": "b124d5f8.620d38",
"type": "template",
"z": "f397e3c.e0ad52",
"name": "javascript",
"field": "payload",
"fieldType": "msg",
"format": "javascript",
"syntax": "mustache",
"template": "async function selectTeam(event) {\n event.preventDefault();\n emptyTable(); \n var team_id = $(\"#team-select option:selected\").val();\n var body = {\"team_id\": team_id};\n\n var response = await fetch(\"/lineups\", {\n \"method\": \"POST\",\n \"body\": JSON.stringify(body),\n \"headers\": {\n \"Content-Type\": \"application/json\"\n }\n }\n )\n \n var data = await response.json(); \n addPlayersToSelect(data);\n}\n\nfunction addPlayersToSelect(data) {\n $('#player-select').empty()\n var roster = data.commonTeamRoster;\n var player_select = document.getElementById(\"player-select\");\n \n roster.forEach((element, index, array) => {\n var li = document.createElement(\"li\");\n li.appendChild(document.createTextNode(element.player));\n li.id = element.playerId;\n li.className = \"list-group-item\"\n li.addEventListener(\"click\", updateLineup)\n player_select.appendChild(li);\n });\n}\n\nfunction updateLineup(event) {\n togglePlayer(event.target);\n updateResult();\n}\n\nfunction togglePlayer(player_li){\n if (player_li.className === \"list-group-item lineup-in\") {\n player_li.className = \"list-group-item lineup-out\";\n } else {\n player_li.className = \"list-group-item lineup-in\";\n }\n}\n\nfunction getActiveLineup() {\n var lineup_html = document.getElementsByClassName(\"lineup-in\");\n var lineup_arr = Array.from(lineup_html);\n var players = [];\n lineup_arr.forEach((element, index, array) => {\n players.push(element.id);\n });\n return players;\n}\n\n\nasync function updateResult() {\n var players = getActiveLineup(); \n \n var MIN_LINEUP_LENGTH = 0; \n var MAX_LINEUP_LENGTH = 5; \n \n if (players.length < MIN_LINEUP_LENGTH || players.length > MAX_LINEUP_LENGTH) {\n return; \n }\n\n var group_quantity = document.getElementById(\"group-quantity\").value;\n var minutes = document.getElementById(\"minutes\").value;\n var season_type = $(\"#season-type option:selected\").val();\n var team_id = $(\"#team-select option:selected\").val();\n\n var body = {\n \"players\": players, \n \"team_id\": team_id,\n \"group_quantity\": group_quantity,\n \"season_type\": season_type,\n \"minutes\": minutes\n };\n var response = await fetch(\"/players\", {\n \"method\": \"POST\",\n \"body\": JSON.stringify(body),\n \"headers\": {\n \"Content-Type\": \"application/json\"\n }\n })\n var data = await response.json();\n addLineupsToResult(data);\n changeMinutes();\n \n}\n\nfunction removeChildren(elem) {\n while (elem.firstChild) {\n elem.removeChild(elem.firstChild);\n }\n}\n\nfunction emptyTable() {\n var tbody = document.getElementById(\"tbody\");\n removeChildren(tbody);\n}\n\nfunction changeMinutes(event) {\n var minutes = parseInt(document.getElementById(\"minutes\").value);\n var tbody = document.getElementById(\"tbody\");\n var rows = tbody.rows;\n for (var i = 0; i < rows.length; i++) {\n var cells = rows[i].cells;\n if (minutes > parseInt(cells[1].innerText)) {\n rows[i].style.display = \"none\";\n } else {\n rows[i].style.display = \"table-row\";\n }\n }\n \n}\n\nfunction addLineupsToResult(data) {\n \n data.sort((a, b) => parseFloat(b.netRating) - parseFloat(a.netRating));\n emptyTable();\n var tbody = document.getElementById(\"tbody\")\n\n data.forEach((element, index, array) => {\n var tr = tbody.insertRow();\n var td = tr.insertCell()\n td.innerHTML = element.groupName;\n \n td = tr.insertCell()\n td.innerHTML = element.min;\n \n td = tr.insertCell()\n td.innerHTML = element.netRating;\n \n td = tr.insertCell()\n td.innerHTML = element.offRating;\n \n td = tr.insertCell()\n td.innerHTML = element.defRating;\n });\n}\n\n",
"output": "str",
"x": 440,
"y": 360,
"wires": [
[
"8ba54d13.11bf2"
]
]
},
{
"id": "b3cf2b8d.bcbb88",
"type": "http in",
"z": "f397e3c.e0ad52",
"name": "",
"url": "/public/lineups.js",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 160,
"y": 360,
"wires": [
[
"b124d5f8.620d38"
]
]
},
{
"id": "8ba54d13.11bf2",
"type": "http response",
"z": "f397e3c.e0ad52",
"name": "",
"statusCode": "",
"headers": {},
"x": 670,
"y": 360,
"wires": []
},
{
"id": "18f38642.1b060a",
"type": "function",
"z": "f397e3c.e0ad52",
"name": "set scripts",
"func": "msg.script = \"lineups.js\";\nmsg.css = \"lineups.css\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 600,
"y": 80,
"wires": [
[
"8e382557.1ebe18"
]
]
},
{
"id": "29b00376.a3530c",
"type": "team",
"z": "f397e3c.e0ad52",
"name": "",
"team_id": "{{payload.team_id}}",
"team_type": "roster",
"season": "2018-19",
"season_type": "Regular Season",
"measure_type": "Base",
"per_mode": "PerGame",
"group_quantity": "5",
"player_team": "P",
"x": 450,
"y": 160,
"wires": [
[
"d31d44e6.eed878"
]
]
},
{
"id": "833dc765.797828",
"type": "template",
"z": "f397e3c.e0ad52",
"name": "CSS",
"field": "payload",
"fieldType": "msg",
"format": "css",
"syntax": "mustache",
"template": "label {\n font-weight: bold;\n}\n\n.lineup-in {\n background-color: lightgreen;\n}\n\n.lineup-in {\n background-color: none;\n}\n\n\n#player-select {\n width: 25%;\n margin-left: 2.5%;\n}\n\n\n#form-div {\n width: 25%;\n margin-left: 2.5%;\n}\n\n\n.result-table {\n width: 60%;\n position: absolute;\n top: 10%;\n right: 5%;\n}\n\n.list-group-item {\n overflow: hidden;\n}",
"output": "str",
"x": 430,
"y": 420,
"wires": [
[
"451aea00.989ea8"
]
]
},
{
"id": "39c9af27.4eb2f",
"type": "http in",
"z": "f397e3c.e0ad52",
"name": "",
"url": "/public/lineups.css",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 160,
"y": 420,
"wires": [
[
"833dc765.797828"
]
]
},
{
"id": "451aea00.989ea8",
"type": "http response",
"z": "f397e3c.e0ad52",
"name": "",
"statusCode": "",
"headers": {
"Content-Type": "text/css"
},
"x": 670,
"y": 420,
"wires": []
},
{
"id": "9fabe64c.ca7f68",
"type": "http in",
"z": "6a8799bb.b0d028",
"name": "",
"url": "/home",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 160,
"y": 100,
"wires": [
[
"36030b4e.f32e24"
]
]
},
{
"id": "ebc3d15.33c0c3",
"type": "link out",
"z": "6a8799bb.b0d028",
"name": "Home",
"links": [
"3867cf53.b064e",
"542cc73b.8cbee8"
],
"x": 755,
"y": 100,
"wires": []
},
{
"id": "36030b4e.f32e24",
"type": "template",
"z": "6a8799bb.b0d028",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "This is where I'd put stuff
",
"output": "str",
"x": 440,
"y": 100,
"wires": [
[
"ebc3d15.33c0c3"
]
]
},
{
"id": "542cc73b.8cbee8",
"type": "link in",
"z": "8927ef63.a862e",
"name": "Render",
"links": [
"299c7d7a.248312",
"2ed77c64.aaa4d4",
"8d7e60d4.1b19f",
"97b73e05.6b7c1",
"db56e500.e2fe08",
"ebc3d15.33c0c3"
],
"x": 195,
"y": 100,
"wires": [
[
"27561996.fc5b46"
]
]
},
{
"id": "27561996.fc5b46",
"type": "template",
"z": "8927ef63.a862e",
"name": "main template",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "\n\n \n \n \n \n \n \n {{!----}}\n\n node-red-contrib-nba\n\n \n \n \n \n \n \n \n\n \n\n \n\n \n {{{payload}}}\n \n\n\n \n \n \n \n \n \n \n \n\n",
"output": "str",
"x": 335,
"y": 100,
"wires": [
[
"de418f5a.988ef"
]
]
},
{
"id": "de418f5a.988ef",
"type": "http response",
"z": "8927ef63.a862e",
"name": "",
"statusCode": "",
"headers": {},
"x": 555,
"y": 100,
"wires": []
},
{
"id": "299c7d7a.248312",
"type": "link out",
"z": "42c39222.3d0e5c",
"name": "Scoreboard",
"links": [
"542cc73b.8cbee8"
],
"x": 1035,
"y": 80,
"wires": []
},
{
"id": "8d7e60d4.1b19f",
"type": "link out",
"z": "60f52c2e.45c274",
"name": "Box score",
"links": [
"542cc73b.8cbee8"
],
"x": 995,
"y": 80,
"wires": []
},
{
"id": "2ed77c64.aaa4d4",
"type": "link out",
"z": "df6d0766.8da398",
"name": "Standings",
"links": [
"542cc73b.8cbee8"
],
"x": 975,
"y": 60,
"wires": []
},
{
"id": "db56e500.e2fe08",
"type": "link out",
"z": "ab4c87ba.ff44c8",
"name": "Play-by-play",
"links": [
"542cc73b.8cbee8"
],
"x": 995,
"y": 80,
"wires": []
},
{
"id": "97b73e05.6b7c1",
"type": "link out",
"z": "f397e3c.e0ad52",
"name": "Lineups",
"links": [
"542cc73b.8cbee8"
],
"x": 955,
"y": 80,
"wires": []
},
{
"id": "c218dbf0.e41c88",
"type": "league",
"z": "46bf11d5.5f89d",
"name": "",
"league_type": "leaders",
"season": "2018-19",
"season_type": "Regular Season",
"game_date": "",
"per_mode": "Totals",
"stat_category": "FG3M",
"sorter": "PTS",
"player_team": "P",
"measure_type": "Base",
"ahead_behind": "",
"point_diff": "",
"clutch_time": "",
"group_quantity": "5",
"pt_measure_type": "",
"x": 340,
"y": 100,
"wires": [
[
"3f03897.fb66076"
]
]
},
{
"id": "64b389eb.306a28",
"type": "ui_chart",
"z": "46bf11d5.5f89d",
"name": "",
"group": "69aa4879.9749c8",
"order": 0,
"width": "13",
"height": "8",
"label": "Top 50 Total 3PT FGM",
"chartType": "line",
"legend": "false",
"xformat": "SSS",
"interpolate": "linear",
"nodata": "waiting for data",
"dot": true,
"ymin": "",
"ymax": "",
"removeOlder": "0",
"removeOlderPoints": "10",
"removeOlderUnit": "1",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 2,
"x": 720,
"y": 180,
"wires": [
[],
[]
]
},
{
"id": "77e5b1a3.257c3",
"type": "ui_button",
"z": "46bf11d5.5f89d",
"name": "",
"group": "69aa4879.9749c8",
"order": 0,
"width": 0,
"height": 0,
"passthru": false,
"label": "call API",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 100,
"y": 100,
"wires": [
[
"c218dbf0.e41c88"
]
]
},
{
"id": "3f6a0659.39053a",
"type": "ui_button",
"z": "46bf11d5.5f89d",
"name": "",
"group": "69aa4879.9749c8",
"order": 0,
"width": 0,
"height": 0,
"passthru": false,
"label": "reset chart",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 110,
"y": 180,
"wires": [
[
"d862dbca.1993b8"
]
]
},
{
"id": "3f03897.fb66076",
"type": "function",
"z": "46bf11d5.5f89d",
"name": "get first 10 players",
"func": "msg.payload = msg.payload.cleanedData.splice(0, 50);\n\nreturn [msg.payload];",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 100,
"wires": [
[
"a442da4.a301d28"
]
]
},
{
"id": "d862dbca.1993b8",
"type": "function",
"z": "46bf11d5.5f89d",
"name": "reset chart",
"func": "msg.payload = [];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 330,
"y": 180,
"wires": [
[
"64b389eb.306a28"
]
]
},
{
"id": "a442da4.a301d28",
"type": "function",
"z": "46bf11d5.5f89d",
"name": "set chart format",
"func": "msg.topic = msg.PLAYER;\nmsg.timestamp = msg.FG3M;\nmsg.payload = msg.FG3_PCT;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 860,
"y": 100,
"wires": [
[
"64b389eb.306a28"
]
]
}
]