From 28792e9da1a4b2914f9642421032123bad05e8a1 Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Sat, 27 Mar 2021 22:04:28 +0800 Subject: [PATCH 1/8] feat: disabled animation for backend get img --- src/App.js | 5 +++++ src/constants.js | 1 + 2 files changed, 6 insertions(+) diff --git a/src/App.js b/src/App.js index 564b48e..f0f8d26 100644 --- a/src/App.js +++ b/src/App.js @@ -400,6 +400,11 @@ const App = () => { { + window.echartsRenderFinished = true; + } + }} ref={e => { if (e) { const echartInstance = e.getEchartsInstance(); diff --git a/src/constants.js b/src/constants.js index 13ab264..bc0dca2 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,4 +1,5 @@ export const DEFAULT_OPTIONS = { + animation: false, legend: { top: "5%", data: [] From 1770866e13392446fcfd7428bfda7d008b9d8ec5 Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Tue, 20 Apr 2021 16:30:34 +0800 Subject: [PATCH 2/8] feat: update --- src/constants.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/constants.js b/src/constants.js index 292861d..66797b9 100644 --- a/src/constants.js +++ b/src/constants.js @@ -5,13 +5,11 @@ export const DEFAULT_OPTIONS = { data: [] }, toolbox: { - feature: { - saveAsImage: {} - } + feature: {} }, dataset: [], title: { - text: "Contributor Over Time" + text: "" }, tooltip: { trigger: "axis" @@ -33,14 +31,12 @@ export const DEFAULT_ACTIVITY_OPTIONS = { data: [] }, toolbox: { - feature: { - saveAsImage: {} - } + feature: {} }, dataset: [], title: { - text: "Monthly Active Contributors", - subtext: 'The number of contributors who committed to main branch in each month' + text: "", + subtext: '' }, tooltip: { trigger: "axis" From 9717806d8dc36b9f38bf967def5148b67b3573b4 Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Thu, 22 Apr 2021 16:52:13 +0800 Subject: [PATCH 3/8] feat: update --- src/components/contributor/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/contributor/index.js b/src/components/contributor/index.js index 06b7236..2850679 100644 --- a/src/components/contributor/index.js +++ b/src/components/contributor/index.js @@ -93,6 +93,7 @@ const ContributorLineChart = ({ repoList = ["apache/apisix"], showAlert, onDelet .then(response => { if (!response.ok) { let message = ""; + window.echartErrorJson = response; switch (response.status) { case 403: message = "Hit rate limit"; From da276aae67aef8785e4dd0f9a3f1b22e8a78ee80 Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Thu, 22 Apr 2021 17:28:00 +0800 Subject: [PATCH 4/8] feat: update --- src/components/contributor/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/contributor/index.js b/src/components/contributor/index.js index 2850679..77cfa74 100644 --- a/src/components/contributor/index.js +++ b/src/components/contributor/index.js @@ -9,7 +9,7 @@ import { Button, ButtonGroup } from "@material-ui/core"; import { getMonths, isSameDay } from "../../utils"; import { DEFAULT_OPTIONS } from "../../constants"; -const ContributorLineChart = ({ repoList = ["apache/apisix"], showAlert, onDelete }) => { +const ContributorLineChart = ({ repoList = [], showAlert, onDelete }) => { const [loading, setLoading] = React.useState(false); const [dataSource, setDataSource] = React.useState({}); const [activeDate, setActiveDate] = React.useState("max"); From 05e972b79d74e7fa217a4c46f311db67a58af81a Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Tue, 27 Apr 2021 23:43:24 +0800 Subject: [PATCH 5/8] feat: add animation --- src/constants.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/constants.js b/src/constants.js index 66797b9..117721c 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,4 +1,5 @@ export const DEFAULT_OPTIONS = { + animation: false, color: ['#39a85a', '#4385ee', '#fabc37', '#2dc1dd', '#f972cf', '#8331c8'], legend: { top: "5%", @@ -25,6 +26,7 @@ export const DEFAULT_OPTIONS = { }; export const DEFAULT_ACTIVITY_OPTIONS = { + animation: false, color: ['#39a85a', '#4385ee', '#fabc37', '#2dc1dd', '#f972cf', '#8331c8'], legend: { top: "5%", From d320f0ff5290ba3aa3fcf2cb3a03c985e23c246a Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Thu, 29 Apr 2021 17:01:18 +0800 Subject: [PATCH 6/8] feat: update --- src/components/contributor/service.js | 58 +++++++++++++-------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/src/components/contributor/service.js b/src/components/contributor/service.js index 86ad0bd..f44c610 100644 --- a/src/components/contributor/service.js +++ b/src/components/contributor/service.js @@ -89,37 +89,33 @@ export const fetchData = (repo, showAlert, onDelete) => { export const fetchMergeContributor = (repo, showAlert) => { return new Promise((resolve, reject) => { - getGithubRepoList(repo).then(data => { - fetch( - `https://contributor-graph-api.apiseven.com/contributors-multi?repo=${data.join( - "," - )}` - ) - .then(response => { - if (!response.ok) { - let message = ""; - switch (response.status) { - case 403: - message = "Hit rate limit"; - break; - case 404: - message = "Repo format error / Repo not found"; - break; - default: - message = "Request Error"; - break; - } - throw message; + fetch( + `https://contributor-graph-api.apiseven.com/contributors-multi?repo=${repo}&merge=true` + ) + .then(response => { + if (!response.ok) { + let message = ""; + switch (response.status) { + case 403: + message = "Hit rate limit"; + break; + case 404: + message = "Repo format error / Repo not found"; + break; + default: + message = "Request Error"; + break; } - return response.json(); - }) - .then(myJson => { - resolve({ repo, ...myJson }); - }) - .catch(e => { - showAlert(e, "error"); - reject(); - }); - }); + throw message; + } + return response.json(); + }) + .then(myJson => { + resolve({ repo, ...myJson }); + }) + .catch(e => { + showAlert(e, "error"); + reject(); + }); }); }; From b962cb8fd32dfd401e8a4e6cc4ec80352e58a519 Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Tue, 18 May 2021 10:20:00 +0800 Subject: [PATCH 7/8] feat: update --- src/components/contributor/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/contributor/index.js b/src/components/contributor/index.js index f2c56c4..2a91ffd 100644 --- a/src/components/contributor/index.js +++ b/src/components/contributor/index.js @@ -388,6 +388,12 @@ const ContributorLineChart = ({ { + window.echartsRenderFinished = true; + } + }} ref={e => { if (e) { const echartInstance = e.getEchartsInstance(); From df58d2ce002507998c104e6003a3194e9ed19d17 Mon Sep 17 00:00:00 2001 From: litesun <7sunmiao@gmail.com> Date: Wed, 19 May 2021 09:53:07 +0800 Subject: [PATCH 8/8] feat: remove title and share icon --- src/constants.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/constants.js b/src/constants.js index 075e7a1..c8dc555 100644 --- a/src/constants.js +++ b/src/constants.js @@ -9,21 +9,11 @@ export const generateDefaultOption = ({ handleShareClick = () => {} }) => { } }, toolbox: { - feature: { - myShare: { - show: true, - title: "Share", - icon: - "path://M830.506667 642.688c-57.344 0-104.192 30.72-126.037334 78.336l-277.162666-117.888c16.170667-25.045333 25.045333-55.722667 25.045333-88.832a167.253333 167.253333 0 0 0-4.864-40.362667l176.981333-137.301333c23.466667 17.749333 53.333333 28.245333 86.485334 28.245333 80 0 139.776-59.733333 139.776-138.88S790.912 87.04 710.954667 87.04c-80 0-139.008 59.733333-139.008 138.922667 0 20.181333 4.053333 38.741333 10.496 54.912L419.2 406.101333c-32.298667-48.469333-85.632-82.389333-146.218667-82.389333a178.944 178.944 0 0 0-179.413333 178.474667v0.853333a178.944 178.944 0 0 0 179.413333 179.2c37.12 0 71.893333-9.642667 100.181334-27.392l318.378666 135.68c4.053333 75.093333 62.250667 130.816 138.965334 130.816 80.042667 0 139.008-59.733333 139.008-138.922667 0-79.146667-59.818667-139.733333-138.965334-139.733333z", - onclick: function() { - handleShareClick(); - } - } - } + feature: {} }, dataset: [], title: { - text: "Contributor Over Time" + text: "" }, tooltip: { trigger: "axis"