Xianbao QIAN
commited on
Commit
·
255b85f
1
Parent(s):
fcf3b2b
update wording display
Browse files- src/pages/index.tsx +12 -10
src/pages/index.tsx
CHANGED
@@ -55,7 +55,7 @@ export default function OpenSourceHeatmap() {
|
|
55 |
// fill in with 0s for days with no activity
|
56 |
for (let d = new Date(startDate); d <= today; d.setDate(d.getDate() + 1)) {
|
57 |
const dateString = d.toISOString().split('T')[0];
|
58 |
-
|
59 |
Object.entries(PROVIDERS_MAP).forEach(([provider]) => {
|
60 |
const count = countMap[provider]?.[dateString] || 0;
|
61 |
data[provider].push({ date: dateString, count, level: 0 });
|
@@ -74,11 +74,11 @@ export default function OpenSourceHeatmap() {
|
|
74 |
Object.entries(data).forEach(([provider, days]) => {
|
75 |
const avgCount = avgCounts[provider];
|
76 |
days.forEach(day => {
|
77 |
-
day.level =
|
78 |
day.count === 0 ? 0 :
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
});
|
83 |
});
|
84 |
|
@@ -117,15 +117,17 @@ export default function OpenSourceHeatmap() {
|
|
117 |
|
118 |
return (
|
119 |
<div className="w-full max-w-screen-lg mx-auto p-4">
|
120 |
-
<h1 className="text-3xl lg:text-5xl mt-16 font-bold text-center mb-2">Chinese AI
|
121 |
-
<p className="text-center text-sm mb-8">
|
122 |
-
|
|
|
|
|
123 |
{isLoading ? (
|
124 |
<p className="text-center">Loading...</p>
|
125 |
) : (
|
126 |
<div className="space-y-8 mx-10">
|
127 |
{Object.entries(PROVIDERS_MAP)
|
128 |
-
.sort(([keyA], [keyB]) =>
|
129 |
calendarData[keyB].reduce((sum, day) => sum + day.count, 0) -
|
130 |
calendarData[keyA].reduce((sum, day) => sum + day.count, 0)
|
131 |
)
|
@@ -134,7 +136,7 @@ export default function OpenSourceHeatmap() {
|
|
134 |
<h2 className="text-xl font-bold mb-2">{providerName}</h2>
|
135 |
<div className="w-full overflow-x-auto">
|
136 |
<div className="inline-block mx-auto">
|
137 |
-
<ActivityCalendar
|
138 |
data={calendarData[providerName]}
|
139 |
theme={{
|
140 |
dark: ['#161b22', color],
|
|
|
55 |
// fill in with 0s for days with no activity
|
56 |
for (let d = new Date(startDate); d <= today; d.setDate(d.getDate() + 1)) {
|
57 |
const dateString = d.toISOString().split('T')[0];
|
58 |
+
|
59 |
Object.entries(PROVIDERS_MAP).forEach(([provider]) => {
|
60 |
const count = countMap[provider]?.[dateString] || 0;
|
61 |
data[provider].push({ date: dateString, count, level: 0 });
|
|
|
74 |
Object.entries(data).forEach(([provider, days]) => {
|
75 |
const avgCount = avgCounts[provider];
|
76 |
days.forEach(day => {
|
77 |
+
day.level =
|
78 |
day.count === 0 ? 0 :
|
79 |
+
day.count <= avgCount * 0.5 ? 1 :
|
80 |
+
day.count <= avgCount ? 2 :
|
81 |
+
day.count <= avgCount * 1.5 ? 3 : 4;
|
82 |
});
|
83 |
});
|
84 |
|
|
|
117 |
|
118 |
return (
|
119 |
<div className="w-full max-w-screen-lg mx-auto p-4">
|
120 |
+
<h1 className="text-3xl lg:text-5xl mt-16 font-bold text-center mb-2">Chinese AI Open Source Heatmap 🤗</h1>
|
121 |
+
<p className="text-center text-sm mb-8">
|
122 |
+
The top AI labs and model releases from the awesome Chinese AI community.<br />
|
123 |
+
Huge thanks to Caleb for the excellent original work. <a href="https://huggingface.co/spaces/cfahlgren1/model-release-heatmap" target="_blank">Link</a> to the original repo
|
124 |
+
</p>
|
125 |
{isLoading ? (
|
126 |
<p className="text-center">Loading...</p>
|
127 |
) : (
|
128 |
<div className="space-y-8 mx-10">
|
129 |
{Object.entries(PROVIDERS_MAP)
|
130 |
+
.sort(([keyA], [keyB]) =>
|
131 |
calendarData[keyB].reduce((sum, day) => sum + day.count, 0) -
|
132 |
calendarData[keyA].reduce((sum, day) => sum + day.count, 0)
|
133 |
)
|
|
|
136 |
<h2 className="text-xl font-bold mb-2">{providerName}</h2>
|
137 |
<div className="w-full overflow-x-auto">
|
138 |
<div className="inline-block mx-auto">
|
139 |
+
<ActivityCalendar
|
140 |
data={calendarData[providerName]}
|
141 |
theme={{
|
142 |
dark: ['#161b22', color],
|