Greasy Fork is available in English.

matchinfo

比赛统计信息页

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/382138/691876/matchinfo.js

  1. var myChart_home, myChart_away;
  2. var mdata;
  3. $(document).ready(function () {
  4.  
  5. $('#mdiv').html('<table><tr><td><select id="TacTeam_home_sec" onchange="TacTeamChange(this.value, true);"></select></td><td><select id="TacTeam_away_sec" onchange="TacTeamChange(this.value, false);"></select></td></tr><tr><td><div id="homeTac" class="Tac"></div></td><td><div id="awayTac" class="Tac"></div></td></tr><tr><td><div style="text-align: center;"><label>上半场</label><table border="1" style="margin: auto;"><tr style="background-color: #ffffe5;"><td id="homeName">主队</td><td>项目</td><td id="awayName">客队</td></tr><tr><td id="homePossession">-</td><td>控球率</td><td id="awayPossession">-</td></tr><tr><td id="homeGoal">-</td><td>进球(点球)</td><td id="awayGoal">-</td></tr><tr><td id="homeSaves">-</td><td>扑救</td><td id="awaySaves">-</td></tr><tr><td id="homeShots">-</td><td>射门/射正</td><td id="awayShots">-</td></tr><tr><td id="homeCards">-</td><td>红/黄牌</td><td id="awayCards">-</td></tr><tr><td id="homeFK">-</td><td>定位/角球</td><td id="awayFK">-</td></tr><tr><td id="homePass">-</td><td>传球次数(成功率)</td><td id="awayPass">-</td></tr><tr><td id="homeTackles">-</td><td>断球(成功率)</td><td id="awayTackles">-</td></tr><tr><td id="homeSubs">-</td><td>换人/受伤</td><td id="awaySubs">-</td></tr><tr><td id="homeThrowins">-</td><td>界外球/越位</td><td id="awayThrowins">-</td></tr></table></div></td><td><div style="text-align: center;"><label>全场</label><table border="1" style="margin: auto;"><tr style="background-color: #ffffe5;"><td id="a_homeName">主队</td><td>项目</td><td id="a_awayName">客队</td></tr><tr><td id="a_homePossession">-</td><td>控球率</td><td id="a_awayPossession">-</td></tr><tr><td id="a_homeGoal">-</td><td>进球(点球)</td><td id="a_awayGoal">-</td></tr><tr><td id="a_homeSaves">-</td><td>扑救</td><td id="a_awaySaves">-</td></tr><tr><td id="a_homeShots">-</td><td>射门/射正</td><td id="a_awayShots">-</td></tr><tr><td id="a_homeCards">-</td><td>红/黄牌</td><td id="a_awayCards">-</td></tr><tr><td id="a_homeFK">-</td><td>定位/角球</td><td id="a_awayFK">-</td></tr><tr><td id="a_homePass">-</td><td>传球次数(成功率)</td><td id="a_awayPass">-</td></tr><tr><td id="a_homeTackles">-</td><td>断球(成功率)</td><td id="a_awayTackles">-</td></tr><tr><td id="a_homeSubs">-</td><td>换人/受伤</td><td id="a_awaySubs">-</td></tr><tr><td id="a_homeThrowins">-</td><td>界外球/越位</td><td id="a_awayThrowins">-</td></tr></table></div></td></tr><tr><td><div id="homeGoalsDiv" style="text-align: center;"></div></td><td><div id="awayGoalsDiv" style="text-align: center;"></div></td></tr></table>');
  6. myChart_home = echarts.init(document.getElementById("homeTac"));
  7. myChart_away = echarts.init(document.getElementById("awayTac"));
  8.  
  9. let json1 = pako.ungzip(base64js.toByteArray(mdata), { to: 'string' });
  10. Show2Doc(JSON.parse(json1));
  11. });
  12. function Show2Doc(data) {
  13.  
  14. AddLBStat(data);
  15. ShowMatchStat(data.stat);
  16. Add2Sec(data);
  17. TacTeamChange(0, true);
  18. TacTeamChange(0, false);
  19.  
  20. }
  21. function TacTeamChange(sec, ishome) {
  22. if (ishome) {
  23. let htxt = match.data.stat.m_homeTeam.m_name + " Goal[" + match.data.stat.m_homeTeam.m_stat.goals + "]";
  24. ShowTeamTac(match, match.data.stat.m_homeTeam.m_id, sec, myChart_home, htxt,'image://https://www.managerzone.com/dynimg/garment.php/n=a/set=home/pi=shirt/pa=3/b=0/c1=2BB8FF/c2=CC0044/lo=/no=/sp=soccer/img.png');
  25. }
  26. else {
  27. let atxt = match.data.stat.m_awayTeam.m_name + " Goal[" + match.data.stat.m_awayTeam.m_stat.goals + "]";
  28. ShowTeamTac(match, match.data.stat.m_awayTeam.m_id, sec, myChart_away, atxt,'image://https://www.managerzone.com/dynimg/garment.php/n=a/set=home/pi=shirt/pa=16/b=0/c1=FF0000/c2=FFFFFF/lo=/no=/sp=soccer/img.png');
  29. }
  30. }
  31.  
  32. var match = {};
  33. function AddLBStat(data) {
  34. if (data) {
  35. match = { sp: {}, data: data };
  36.  
  37. for (let i_id in data.longPass) {
  38. let pid = data.stat.m_players[i_id].Pid;
  39. if (match.sp[pid] == undefined) {
  40. match.sp[pid] = {
  41. item: data.stat.m_players[i_id],
  42. EP: {}
  43. };
  44. }
  45.  
  46. for (let i = 0; i < data.longPass[i_id].length; i++) {
  47. let item = data.longPass[i_id][i];
  48. if (item.team) {
  49. let jpid = data.stat.m_players[item.team.player.m_id].Pid;
  50. if (match.sp[pid].EP[jpid] == undefined) {
  51. match.sp[pid].EP[jpid] = {
  52. count: 1,
  53. item: data.stat.m_players[item.team.player.m_id]
  54. };
  55. } else {
  56. match.sp[pid].EP[jpid].count += 1;
  57. }
  58. }
  59. }
  60. }
  61.  
  62. }
  63.  
  64. }
  65.  
  66. function ShowMatchStat(stat) {
  67.  
  68.  
  69. $('#homeName').html(stat.m_homeTeam.m_shortname);
  70. $('#awayName').html(stat.m_awayTeam.m_shortname);
  71. $('#homePossession').html(stat.m_homeTeam.m_HalfStatistics.possession + "%");
  72. $('#awayPossession').html(stat.m_awayTeam.m_HalfStatistics.possession + "%");
  73. $('#homeGoal').html(stat.m_homeTeam.m_HalfStatistics.goals);
  74. $('#awayGoal').html(stat.m_awayTeam.m_HalfStatistics.goals);
  75. $('#homeSaves').html(stat.m_homeTeam.m_HalfStatistics.saves);
  76. $('#awaySaves').html(stat.m_awayTeam.m_HalfStatistics.saves);
  77. $('#homeShots').html((parseInt(stat.m_homeTeam.m_HalfStatistics.shotsOnGoal) + parseInt(stat.m_homeTeam.m_HalfStatistics.shotsWide)) + "/" + stat.m_homeTeam.m_HalfStatistics.shotsOnGoal);
  78. $('#awayShots').html((parseInt(stat.m_awayTeam.m_HalfStatistics.shotsOnGoal) + parseInt(stat.m_awayTeam.m_HalfStatistics.shotsWide)) + "/" + stat.m_awayTeam.m_HalfStatistics.shotsOnGoal);
  79. $('#homeCards').html(stat.m_homeTeam.m_HalfStatistics.redCards + "/" + stat.m_homeTeam.m_HalfStatistics.yellowCards);
  80. $('#awayCards').html(stat.m_awayTeam.m_HalfStatistics.redCards + "/" + stat.m_awayTeam.m_HalfStatistics.yellowCards);
  81. $('#homeFK').html(stat.m_homeTeam.m_HalfStatistics.freekicks + "/" + stat.m_homeTeam.m_HalfStatistics.corners);
  82. $('#awayFK').html(stat.m_awayTeam.m_HalfStatistics.freekicks + "/" + stat.m_awayTeam.m_HalfStatistics.corners);
  83. let pass = parseInt(stat.m_homeTeam.m_HalfStatistics.goodPasses) + parseInt(stat.m_homeTeam.m_HalfStatistics.interceptedPasses) + parseInt(stat.m_homeTeam.m_HalfStatistics.oobPasses);
  84. $('#homePass').html(pass + "(" + (stat.m_homeTeam.m_HalfStatistics.goodPasses * 100 / pass).toFixed(2) + "%)");
  85. pass = parseInt(stat.m_awayTeam.m_HalfStatistics.goodPasses) + parseInt(stat.m_awayTeam.m_HalfStatistics.interceptedPasses) + parseInt(stat.m_awayTeam.m_HalfStatistics.oobPasses);
  86. $('#awayPass').html(pass + "(" + (stat.m_awayTeam.m_HalfStatistics.goodPasses * 100 / pass).toFixed(2) + "%)");
  87. let tackles = parseInt(stat.m_homeTeam.m_HalfStatistics.tacklesLost) + parseInt(stat.m_homeTeam.m_HalfStatistics.tacklesWon);
  88. $('#homeTackles').html(tackles + "(" + (stat.m_homeTeam.m_HalfStatistics.tacklesWon * 100 / tackles).toFixed(2) + "%)");
  89. tackles = parseInt(stat.m_awayTeam.m_HalfStatistics.tacklesLost) + parseInt(stat.m_awayTeam.m_HalfStatistics.tacklesWon);
  90. $('#awayTackles').html(tackles + "(" + (stat.m_awayTeam.m_HalfStatistics.tacklesWon * 100 / tackles).toFixed(2) + "%)");
  91. $('#homeSubs').html(stat.m_homeTeam.m_HalfStatistics.substitutions + "/" + stat.m_homeTeam.m_HalfStatistics.injuries);
  92. $('#awaySubs').html(stat.m_awayTeam.m_HalfStatistics.substitutions + "/" + stat.m_awayTeam.m_HalfStatistics.injuries);
  93. $('#homeThrowins').html(stat.m_homeTeam.m_HalfStatistics.throwins + "/" + stat.m_homeTeam.m_HalfStatistics.offsides);
  94. $('#awayThrowins').html(stat.m_awayTeam.m_HalfStatistics.throwins + "/" + stat.m_awayTeam.m_HalfStatistics.offsides);
  95.  
  96.  
  97.  
  98. $('#a_homeName').html(stat.m_homeTeam.m_shortname);
  99. $('#a_awayName').html(stat.m_awayTeam.m_shortname);
  100. $('#a_homePossession').html(stat.m_homeTeam.m_Statistics.possession + "%");
  101. $('#a_awayPossession').html(stat.m_awayTeam.m_Statistics.possession + "%");
  102. $('#a_homeGoal').html(stat.m_homeTeam.m_Statistics.goals);
  103. $('#a_awayGoal').html(stat.m_awayTeam.m_Statistics.goals);
  104. $('#a_homeSaves').html(stat.m_homeTeam.m_Statistics.saves);
  105. $('#a_awaySaves').html(stat.m_awayTeam.m_Statistics.saves);
  106. $('#a_homeShots').html((parseInt(stat.m_homeTeam.m_Statistics.shotsOnGoal) + parseInt(stat.m_homeTeam.m_Statistics.shotsWide)) + "/" + stat.m_homeTeam.m_Statistics.shotsOnGoal);
  107. $('#a_awayShots').html((parseInt(stat.m_awayTeam.m_Statistics.shotsOnGoal) + parseInt(stat.m_awayTeam.m_Statistics.shotsWide)) + "/" + stat.m_awayTeam.m_Statistics.shotsOnGoal);
  108. $('#a_homeCards').html(stat.m_homeTeam.m_Statistics.redCards + "/" + stat.m_homeTeam.m_Statistics.yellowCards);
  109. $('#a_awayCards').html(stat.m_awayTeam.m_Statistics.redCards + "/" + stat.m_awayTeam.m_Statistics.yellowCards);
  110. $('#a_homeFK').html(stat.m_homeTeam.m_Statistics.freekicks + "/" + stat.m_homeTeam.m_Statistics.corners);
  111. $('#a_awayFK').html(stat.m_awayTeam.m_Statistics.freekicks + "/" + stat.m_awayTeam.m_Statistics.corners);
  112. pass = parseInt(stat.m_homeTeam.m_Statistics.goodPasses) + parseInt(stat.m_homeTeam.m_Statistics.interceptedPasses) + parseInt(stat.m_homeTeam.m_Statistics.oobPasses);
  113. $('#a_homePass').html(pass + "(" + (stat.m_homeTeam.m_Statistics.goodPasses * 100 / pass).toFixed(2) + "%)");
  114. pass = parseInt(stat.m_awayTeam.m_Statistics.goodPasses) + parseInt(stat.m_awayTeam.m_Statistics.interceptedPasses) + parseInt(stat.m_awayTeam.m_Statistics.oobPasses);
  115. $('#a_awayPass').html(pass + "(" + (stat.m_awayTeam.m_Statistics.goodPasses * 100 / pass).toFixed(2) + "%)");
  116. tackles = parseInt(stat.m_homeTeam.m_Statistics.tacklesLost) + parseInt(stat.m_homeTeam.m_Statistics.tacklesWon);
  117. $('#a_homeTackles').html(tackles + "(" + (stat.m_homeTeam.m_Statistics.tacklesWon * 100 / tackles).toFixed(2) + "%)");
  118. tackles = parseInt(stat.m_awayTeam.m_Statistics.tacklesLost) + parseInt(stat.m_awayTeam.m_Statistics.tacklesWon);
  119. $('#a_awayTackles').html(tackles + "(" + (stat.m_awayTeam.m_Statistics.tacklesWon * 100 / tackles).toFixed(2) + "%)");
  120. $('#a_homeSubs').html(stat.m_homeTeam.m_Statistics.substitutions + "/" + stat.m_homeTeam.m_Statistics.injuries);
  121. $('#a_awaySubs').html(stat.m_awayTeam.m_Statistics.substitutions + "/" + stat.m_awayTeam.m_Statistics.injuries);
  122. $('#a_homeThrowins').html(stat.m_homeTeam.m_Statistics.throwins + "/" + stat.m_homeTeam.m_Statistics.offsides);
  123. $('#a_awayThrowins').html(stat.m_awayTeam.m_Statistics.throwins + "/" + stat.m_awayTeam.m_Statistics.offsides);
  124.  
  125.  
  126. $('#homeGoalsDiv').empty();
  127. $('#awayGoalsDiv').empty();
  128. $('#homeGoalsDiv').append("<div><b>首发战术 " + stat.m_homeTeam.m_tactic + "," + stat.m_homeTeam.m_playstyle + "," + stat.m_homeTeam.m_aggression + "</b></div>");
  129. $('#awayGoalsDiv').append("<div><b>首发战术 " + stat.m_awayTeam.m_tactic + "," + stat.m_awayTeam.m_playstyle + "," + stat.m_awayTeam.m_aggression + "</b></div>");
  130.  
  131. let tgdiv_home = new Array();
  132. let tgdiv_away = new Array();
  133. let tmpPid_Player = {};
  134. let tgdiv;
  135. for (let pid in stat.m_players) {
  136. tmpPid_Player[stat.m_players[pid].Pid] = stat.m_players[pid];
  137. if (stat.m_players[pid].m_stat.goals > 0 || stat.m_players[pid].m_stat.owngoals > 0||stat.m_players[pid].m_stat.yellowCards>0||stat.m_players[pid].m_stat.redCards>0) {
  138. for (let i = 0; i < stat.m_players[pid].m_events.length; i++) {
  139. if (stat.m_players[pid].m_events[i].m_type == 5) {
  140. if (stat.m_players[pid].m_events[i].m_teamId == stat.m_homeTeam.m_id) {
  141. tgdiv = tgdiv_home;
  142. } else {
  143. tgdiv = tgdiv_away;
  144. }
  145. let goaltxt = "";
  146. let goalsrc="";
  147. if (stat.m_players[pid].m_teamId != stat.m_players[pid].m_events[i].m_teamId) {
  148. goaltxt = "乌龙 "
  149. goalsrc='https://www.managerzone.com/nocache-702/img/soccer/match/own_goal.png';
  150. }else{
  151. goaltxt = "进球 "
  152. goalsrc='https://www.managerzone.com/nocache-702/img/soccer/match/goal.png';
  153. }
  154. tgdiv.push({
  155. html: "<div>" + goaltxt+ stat.m_players[pid].m_events[i].Time + "′ " + stat.m_players[pid].m_name + "(" + stat.m_players[pid].m_shirtNo + ') <img src="'+goalsrc+'" width="13" height="13" alt=""></div>',
  156. time: timeToFrame(stat.m_players[pid].m_events[i].Time)
  157. });
  158. }else{
  159. if (stat.m_players[pid].m_teamId == stat.m_homeTeam.m_id) {
  160. tgdiv = tgdiv_home;
  161. } else {
  162. tgdiv = tgdiv_away;
  163. }
  164. if(stat.m_players[pid].m_events[i].m_type == 16) {
  165. tgdiv.push({
  166. html: "<div>红牌 " + stat.m_players[pid].m_events[i].Time + "′ " + stat.m_players[pid].m_name + "(" + stat.m_players[pid].m_shirtNo + ') <img src="https://www.managerzone.com/nocache-702/img/soccer/card_red.png" height="13" alt=""></div>',
  167. time: timeToFrame(stat.m_players[pid].m_events[i].Time)
  168. });
  169. }else if(stat.m_players[pid].m_events[i].m_type == 17) {
  170. tgdiv.push({
  171. html: "<div>黄牌 " + stat.m_players[pid].m_events[i].Time + "′ " + stat.m_players[pid].m_name + "(" + stat.m_players[pid].m_shirtNo + ') <img src="https://www.managerzone.com/nocache-702/img/soccer/card_yellow.png" width="13" height="13" alt=""></div>',
  172. time: timeToFrame(stat.m_players[pid].m_events[i].Time)
  173. });
  174. }else if(stat.m_players[pid].m_events[i].m_type == 18) {
  175. tgdiv.push({
  176. html: "<div>双黄 " + stat.m_players[pid].m_events[i].Time + "′ " + stat.m_players[pid].m_name + "(" + stat.m_players[pid].m_shirtNo + ') <img src="https://www.managerzone.com/nocache-702/img/soccer/card_yellow_red.png" height="13" alt=""></div>',
  177. time: timeToFrame(stat.m_players[pid].m_events[i].Time)
  178. });
  179. }
  180. }
  181. }
  182. }
  183. }
  184.  
  185. for (let i = 0; i < stat.Events.length; i++) {
  186. if (stat.Events[i].tagName == "Tactic") {
  187.  
  188. if (stat.Events[i].attributes["teamId"] == stat.m_homeTeam.m_id) {
  189. tgdiv = tgdiv_home;
  190. } else {
  191. tgdiv = tgdiv_away;
  192. }
  193. tgdiv.push({
  194. html: "<div>" + stat.Events[i].attributes["time"] + "′ " + stat.Events[i].attributes["type"] + "->" + stat.Events[i].attributes["new_setting"],
  195. time: timeToFrame(stat.Events[i].attributes["time"])
  196. });
  197. } else if (stat.Events[i].tagName == "Substitution") {
  198.  
  199. if (stat.Events[i].attributes["teamId"] == stat.m_homeTeam.m_id) {
  200. tgdiv = tgdiv_home;
  201. } else {
  202. tgdiv = tgdiv_away;
  203. }
  204. let player = tmpPid_Player[stat.Events[i].attributes["playerId"]];
  205. let sub_player = tmpPid_Player[stat.Events[i].attributes["substitutedId"]];
  206. tgdiv.push({
  207. html: "<div>" + stat.Events[i].attributes["time"] + "′ "
  208. + player.m_name + "(" + player.m_shirtNo + ")↑ "
  209. + sub_player.m_name + "(" + sub_player.m_shirtNo + ")↓ "
  210. + stat.Events[i].attributes["reason"] + stat.Events[i].attributes["minute"]
  211. + ((stat.Events[i].attributes["scorecondition"] == undefined) ? "" : (" " + stat.Events[i].attributes["scorecondition"] + " " + stat.Events[i].attributes["score"])),
  212. time: timeToFrame(stat.Events[i].attributes["time"])
  213. });
  214. }
  215. }
  216.  
  217. tgdiv_home.sort(function (a, b) {
  218. return a.time - b.time;
  219. });
  220. tgdiv_away.sort(function (a, b) {
  221. return a.time - b.time;
  222. });
  223.  
  224. for (let i = 0; i < tgdiv_home.length; i++) {
  225. $('#homeGoalsDiv').append(tgdiv_home[i].html);
  226. }
  227. for (let i = 0; i < tgdiv_away.length; i++) {
  228. $('#awayGoalsDiv').append(tgdiv_away[i].html);
  229. }
  230.  
  231. }
  232. function Add2Sec(data) {
  233. $("#TacTeam_home_sec").empty();
  234. $("#TacTeam_home_sec").append("<option value='0'>首发</option>");
  235. $("#TacTeam_away_sec").empty();
  236. $("#TacTeam_away_sec").append("<option value='0'>首发</option>");
  237. for (let sf in data.xys) {
  238. $("#TacTeam_home_sec").append("<option value='" + sf + "'>" + frameToMatchMinute(sf) + "分钟</option>");
  239. $("#TacTeam_away_sec").append("<option value='" + sf + "'>" + frameToMatchMinute(sf) + "分钟</option>");
  240. }
  241. }
  242. function ShowTeamTac(match, tid, sec, myChart, tv_txt,symbol) {
  243.  
  244. let arr = { data: new Array(), links: new Array(), categories: new Array() };
  245. let tmplk = {};
  246.  
  247. let mlen = 1;
  248. let needTxy = false;
  249.  
  250. if (match) {
  251. let stat = match.data.stat;
  252. let data = match.data;
  253.  
  254. if (sec > 0) {
  255. let frame = data.xys[sec];
  256. for (let pi = 0; pi < frame.players.length; pi++) {
  257. let pitem = frame.players[pi];
  258. if (pitem.position) {
  259. let item = stat.m_players[pitem.id];
  260. if (item.m_teamId == tid) {
  261.  
  262. let ddtmp = GetHalf(sec, stat);
  263. let needTxy_tmp = needTxy;
  264. if (ddtmp.dd % 2 == 1) {
  265. needTxy_tmp = !needTxy_tmp;
  266. }
  267.  
  268. let id = arr.data.length;
  269. let x = pitem.position.y;
  270. let y = pitem.position.x;
  271. if (needTxy_tmp) {
  272. x = 1000 - x;
  273. } else {
  274. y = 750 - y;
  275. }
  276. arr.data.push({
  277. category: arr.categories.length,
  278. id: id,
  279. name: item.m_name + "(" + item.Pid + ")",
  280. x: x,
  281. y: y,
  282. value: item.m_shirtNo
  283. });
  284.  
  285.  
  286.  
  287. arr.categories.push({
  288. name: item.m_name
  289.  
  290. });
  291. tmplk[item.Pid] = { links: arr.links, id: id, name: item.m_name };
  292. }
  293. }
  294.  
  295. }
  296. } else {
  297. for (let ipid in stat.m_players) {
  298.  
  299. let item = stat.m_players[ipid];
  300.  
  301. if (item.originY >= 0 && item.m_teamId == tid) {
  302.  
  303. let id = arr.data.length;
  304. let x = item.originY;
  305. let y = item.originX;
  306. if (needTxy) {
  307. x = 1000 - x;
  308. } else {
  309. y = 750 - y;
  310. }
  311. arr.data.push({
  312. category: arr.categories.length,
  313. id: id,
  314. name: item.m_name + "(" + item.Pid + ")",
  315. x: x,
  316. y: y,
  317. value: item.m_shirtNo
  318. });
  319.  
  320.  
  321.  
  322. arr.categories.push({
  323. name: item.m_name
  324.  
  325. });
  326. tmplk[item.Pid] = { links: arr.links, id: id, name: item.m_name };
  327. }
  328. }
  329.  
  330. }
  331.  
  332.  
  333. if (match.sp) {
  334. let sps = match.sp;
  335. for (let sp in sps) {
  336. for (let ep in sps[sp].EP) {
  337. if (ep != sp) {
  338. if (tmplk[ep] && tmplk[sp]) {
  339. tmplk[sp].links.push(
  340. {
  341. symbol: ['none', 'arrow'],
  342. symbolSize: 20,
  343. id: tmplk[sp].links.length,
  344. name: null,
  345. value: (sps[sp].EP[ep].count / mlen).toFixed(1),
  346.  
  347. source: tmplk[sp].id,
  348. target: tmplk[ep].id,
  349. lineStyle: {
  350. width: 2 * sps[sp].EP[ep].count / mlen,
  351. curveness: 0.2
  352. },
  353. label: {
  354. show: true,
  355. formatter: '{c}'
  356.  
  357. },
  358. emphasis: {
  359. lineStyle: {
  360. width: 2 * sps[sp].EP[ep].count / mlen + 2
  361. }
  362. }
  363. });
  364. }
  365.  
  366. }
  367. }
  368. }
  369. }
  370. }
  371.  
  372. var option_home = {
  373. title: {
  374. text: tv_txt,
  375. subtext: 'Default layout',
  376. top: 'bottom',
  377. left: 'right'
  378. },
  379. tooltip: {
  380. formatter: function () {
  381. if (typeof (arguments[0].name) == "string" && arguments[0].name.indexOf("(") > 0) {
  382. return undefined;
  383. } else {
  384. return arguments[0].value;
  385. }
  386.  
  387. }
  388. },
  389. //legend: [{
  390. // // selectedMode: 'single',
  391. // data: arr.categories.map(function (a) {
  392. // return a.name;
  393. // })
  394. //}],
  395. animationDuration: 1500,
  396. animationEasingUpdate: 'quinticInOut',
  397. series: [
  398. {
  399.  
  400. //name: '球员',
  401. type: 'graph',
  402. layout: 'none',
  403. symbol: symbol,
  404. symbolSize: 35,
  405. data: arr.data,
  406. links: arr.links,
  407. categories: arr.categories,
  408. roam: true,
  409. focusNodeAdjacency: true,
  410. itemStyle: {
  411. normal: {
  412. borderColor: '#fff',
  413. borderWidth: 1,
  414. shadowBlur: 10,
  415. shadowColor: 'rgba(0, 0, 0, 0.3)'
  416. }
  417. },
  418. label: {
  419. show: true,
  420. formatter: '{c}',
  421. distance: 0
  422. },
  423. lineStyle: {
  424. color: 'source',
  425. curveness: 0.3
  426. },
  427. emphasis: {
  428. label: {
  429. show: true,
  430. formatter: "{b}"
  431. }
  432. }
  433. }
  434. ]
  435. };
  436.  
  437. myChart.setOption(option_home, true);
  438.  
  439. }
  440.  
  441. function GetHalf(frame, stat) {
  442. let d = "未知";
  443. let dd = 0;
  444. if (frame <= stat.eFrameHf1) {
  445. d = "上";
  446. dd = 1;
  447. } else if (frame >= stat.sFrameHf2 && frame <= stat.eFrameHf2) {
  448. d = "下";
  449. dd = 2;
  450. } else if (frame >= stat.sFrameHf3 && frame <= stat.eFrameHf3) {
  451. d = "加上";
  452. dd = 3;
  453. } else if (frame >= stat.sFrameHf4 && frame <= stat.eFrameHf4) {
  454. d = "加下";
  455. dd = 4;
  456. }
  457. return {
  458. d: d,
  459. dd: dd
  460. }
  461.  
  462. }
  463.  
  464. function frameToMatchMinute(frame) {
  465. let m_secsPerFrame = 0.6666667;
  466. return Math.ceil(frame * m_secsPerFrame / 60);
  467. };
  468. function timeToFrame(timeToParse) {
  469. var seconds = 0;
  470. try {
  471. var colonIdx = timeToParse.indexOf(":");
  472. var minute = parseInt(timeToParse.substring(0, colonIdx), 10);
  473. var second = parseFloat(timeToParse.substring(colonIdx + 1), 10);
  474. seconds = (minute * 60) + second;
  475. } catch (e) {
  476. console.log('Error converting ' + time + ' to frame number ' + e.message);
  477. }
  478. return Math.round(seconds / 0.6666667);
  479. };