timqian commited on
Commit
6cc6e46
1 Parent(s): 72c9f9b

get projects from hash

Browse files
asset-manifest.json CHANGED
@@ -1,15 +1,15 @@
1
  {
2
  "files": {
3
  "main.css": "/static/css/main.5173ff82.css",
4
- "main.js": "/static/js/main.f1c76c48.js",
5
  "static/js/787.0bfccc2a.chunk.js": "/static/js/787.0bfccc2a.chunk.js",
6
  "index.html": "/index.html",
7
  "main.5173ff82.css.map": "/static/css/main.5173ff82.css.map",
8
- "main.f1c76c48.js.map": "/static/js/main.f1c76c48.js.map",
9
  "787.0bfccc2a.chunk.js.map": "/static/js/787.0bfccc2a.chunk.js.map"
10
  },
11
  "entrypoints": [
12
  "static/css/main.5173ff82.css",
13
- "static/js/main.f1c76c48.js"
14
  ]
15
  }
 
1
  {
2
  "files": {
3
  "main.css": "/static/css/main.5173ff82.css",
4
+ "main.js": "/static/js/main.98a30b5e.js",
5
  "static/js/787.0bfccc2a.chunk.js": "/static/js/787.0bfccc2a.chunk.js",
6
  "index.html": "/index.html",
7
  "main.5173ff82.css.map": "/static/css/main.5173ff82.css.map",
8
+ "main.98a30b5e.js.map": "/static/js/main.98a30b5e.js.map",
9
  "787.0bfccc2a.chunk.js.map": "/static/js/787.0bfccc2a.chunk.js.map"
10
  },
11
  "entrypoints": [
12
  "static/css/main.5173ff82.css",
13
+ "static/js/main.98a30b5e.js"
14
  ]
15
  }
index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="View the like history of a project on huggingface"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Like History</title><script defer="defer" src="/static/js/main.f1c76c48.js"></script><link href="/static/css/main.5173ff82.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
 
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="View the like history of a project on huggingface"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Like History</title><script defer="defer" src="/static/js/main.98a30b5e.js"></script><link href="/static/css/main.5173ff82.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
src/App.js CHANGED
@@ -27,11 +27,13 @@ function transformLikesData(likesData) {
27
 
28
  function getProjectsFromHash() {
29
  let hash = window.location.hash;
30
- console.log('hash', hash)
31
  const projects = hash.replace("#", "").split('&').filter(project => project !== '');
32
  return projects;
33
  }
34
 
 
 
35
  function App() {
36
  const [projectType, setProjectType] = useState("models");
37
  const [projectName, setProjectName] = useState("");
@@ -101,7 +103,7 @@ function App() {
101
 
102
  useEffect(() => {
103
  const svg = document.querySelector('.line-chart')
104
- if (datasets.length == 0) {
105
  svg.innerHTML = ''
106
  setHash()
107
  return
@@ -162,7 +164,7 @@ function App() {
162
  }, []);
163
 
164
  useEffect(() => {
165
- const projects = getProjectsFromHash();
166
  if (projects.length <= 0) return;
167
 
168
  async function getLikeHistoryAndDisplay() {
 
27
 
28
  function getProjectsFromHash() {
29
  let hash = window.location.hash;
30
+ console.log('hash', hash)
31
  const projects = hash.replace("#", "").split('&').filter(project => project !== '');
32
  return projects;
33
  }
34
 
35
+ const initProjects = getProjectsFromHash();
36
+
37
  function App() {
38
  const [projectType, setProjectType] = useState("models");
39
  const [projectName, setProjectName] = useState("");
 
103
 
104
  useEffect(() => {
105
  const svg = document.querySelector('.line-chart')
106
+ if (datasets.length === 0) {
107
  svg.innerHTML = ''
108
  setHash()
109
  return
 
164
  }, []);
165
 
166
  useEffect(() => {
167
+ const projects = initProjects;
168
  if (projects.length <= 0) return;
169
 
170
  async function getLikeHistoryAndDisplay() {
src/index.js CHANGED
@@ -6,9 +6,9 @@ import reportWebVitals from './reportWebVitals';
6
 
7
  const root = ReactDOM.createRoot(document.getElementById('root'));
8
  root.render(
9
- <React.StrictMode>
10
  <App />
11
- </React.StrictMode>
12
  );
13
 
14
  // If you want to start measuring performance in your app, pass a function
 
6
 
7
  const root = ReactDOM.createRoot(document.getElementById('root'));
8
  root.render(
9
+ // <React.StrictMode>
10
  <App />
11
+ // </React.StrictMode>
12
  );
13
 
14
  // If you want to start measuring performance in your app, pass a function
static/js/main.98a30b5e.js ADDED
The diff for this file is too large to render. See raw diff
 
static/js/main.98a30b5e.js.LICENSE.txt ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
2
+
3
+ /**
4
+ * @license React
5
+ * react-dom.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+
13
+ /**
14
+ * @license React
15
+ * react-jsx-runtime.production.min.js
16
+ *
17
+ * Copyright (c) Facebook, Inc. and its affiliates.
18
+ *
19
+ * This source code is licensed under the MIT license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ */
22
+
23
+ /**
24
+ * @license React
25
+ * react.production.min.js
26
+ *
27
+ * Copyright (c) Facebook, Inc. and its affiliates.
28
+ *
29
+ * This source code is licensed under the MIT license found in the
30
+ * LICENSE file in the root directory of this source tree.
31
+ */
32
+
33
+ /**
34
+ * @license React
35
+ * scheduler.production.min.js
36
+ *
37
+ * Copyright (c) Facebook, Inc. and its affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */
static/js/main.98a30b5e.js.map ADDED
The diff for this file is too large to render. See raw diff