nicer colors
Browse files- dist/index.html +1 -1
- dist/main.bundle.js +0 -0
- dist/main.bundle.js.map +0 -0
- src/clusters.js +2 -16
- src/colors.mjs +11 -12
- src/index.html +1 -1
dist/index.html
CHANGED
@@ -164,7 +164,7 @@
|
|
164 |
<h1 class="l-page" style="text-align: center;">π· FineWeb: decanting the web for the finest text data at scale</h1>
|
165 |
<div id="title-plot" class="main-plot-container l-screen">
|
166 |
<figure>
|
167 |
-
<img src="assets/images/
|
168 |
</figure>
|
169 |
<div id="clusters-plot">
|
170 |
<img src="assets/images/clusters.png" alt="Clusters">
|
|
|
164 |
<h1 class="l-page" style="text-align: center;">π· FineWeb: decanting the web for the finest text data at scale</h1>
|
165 |
<div id="title-plot" class="main-plot-container l-screen">
|
166 |
<figure>
|
167 |
+
<img src="assets/images/clusters.png" alt="FineWeb">
|
168 |
</figure>
|
169 |
<div id="clusters-plot">
|
170 |
<img src="assets/images/clusters.png" alt="Clusters">
|
dist/main.bundle.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
dist/main.bundle.js.map
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
src/clusters.js
CHANGED
@@ -76,7 +76,7 @@ const addStylingToAnnotations = (annotations) => {
|
|
76 |
color: "black",
|
77 |
weight: "bold",
|
78 |
},
|
79 |
-
bgcolor: getColor(annotation.label, 0.
|
80 |
borderpad: 2, // Add padding around the text
|
81 |
...annotation,
|
82 |
};
|
@@ -113,19 +113,6 @@ const readData = async () => {
|
|
113 |
}));
|
114 |
};
|
115 |
|
116 |
-
const restyleTraces = (traces, zoomLevel) => {
|
117 |
-
const res = [
|
118 |
-
{
|
119 |
-
...traces[0],
|
120 |
-
marker: {
|
121 |
-
...traces[0].marker,
|
122 |
-
size: BASE_SIZE * zoomLevel,
|
123 |
-
},
|
124 |
-
},
|
125 |
-
];
|
126 |
-
return res;
|
127 |
-
};
|
128 |
-
|
129 |
// The cluster is pretty big, so takes time to donwload
|
130 |
// In the meantime we put there a placeholder image
|
131 |
const destroyPlaceholderImage = (parent) => {
|
@@ -160,9 +147,8 @@ export async function plotClusters() {
|
|
160 |
x: data.map((row) => row.x),
|
161 |
y: data.map((row) => row.y),
|
162 |
marker: {
|
163 |
-
color: data.map((row) => getColor(row.label,
|
164 |
size: BASE_SIZE,
|
165 |
-
opacity: 8,
|
166 |
},
|
167 |
hoverinfo: "text",
|
168 |
hovertext: data.map((row) => getLabelHoverFormat(row, labelIDToName)),
|
|
|
76 |
color: "black",
|
77 |
weight: "bold",
|
78 |
},
|
79 |
+
bgcolor: getColor(annotation.label, 0.6),
|
80 |
borderpad: 2, // Add padding around the text
|
81 |
...annotation,
|
82 |
};
|
|
|
113 |
}));
|
114 |
};
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
// The cluster is pretty big, so takes time to donwload
|
117 |
// In the meantime we put there a placeholder image
|
118 |
const destroyPlaceholderImage = (parent) => {
|
|
|
147 |
x: data.map((row) => row.x),
|
148 |
y: data.map((row) => row.y),
|
149 |
marker: {
|
150 |
+
color: data.map((row) => getColor(row.label, 0.4)),
|
151 |
size: BASE_SIZE,
|
|
|
152 |
},
|
153 |
hoverinfo: "text",
|
154 |
hovertext: data.map((row) => getLabelHoverFormat(row, labelIDToName)),
|
src/colors.mjs
CHANGED
@@ -30,23 +30,22 @@ const COLORS = [
|
|
30 |
["46", "145", "229"], // Sky Blue
|
31 |
["225", "95", "153"], // Soft Magenta
|
32 |
["28", "167", "28"], // Bright Green
|
33 |
-
["108", "69", "22"], // Dark Brown
|
34 |
-
["
|
35 |
-
["
|
|
|
|
|
36 |
["175", "0", "56"], // Crimson
|
37 |
["108", "124", "50"], // Olive Green
|
|
|
|
|
|
|
38 |
// ['34', '42', '42'], Black, which makes the text unreadable
|
39 |
-
["
|
40 |
-
["117", "13", "134"], // Deep Magenta
|
41 |
-
["0", "160", "139"], // Teal
|
42 |
["251", "0", "209"], // Hot Pink
|
43 |
["252", "0", "128"], // Bright Pink
|
44 |
-
["178", "130", "141"], // Dusty Pink
|
45 |
-
["218", "22", "255"], // Electric Purple
|
46 |
["119", "138", "174"], // Slate Blue
|
47 |
-
["134", "42", "22"], // Brick Red
|
48 |
-
["167", "119", "241"], // Lavender
|
49 |
-
["98", "0", "66"], // Dark Magenta
|
50 |
["22", "22", "167"], // Deep Blue
|
51 |
["218", "96", "202"], // Orchid
|
52 |
// ['13', '42', '99'], Black
|
@@ -56,7 +55,7 @@ const COLORS = [
|
|
56 |
|
57 |
|
58 |
export const NAMED_COLORS = {
|
59 |
-
"red": ["251", "13", "13"]
|
60 |
};
|
61 |
|
62 |
export const getColor = (i, opacity=1) => {
|
|
|
30 |
["46", "145", "229"], // Sky Blue
|
31 |
["225", "95", "153"], // Soft Magenta
|
32 |
["28", "167", "28"], // Bright Green
|
33 |
+
// ["108", "69", "22"], // Dark Brown
|
34 |
+
["167", "119", "241"], // Lavender
|
35 |
+
["182", "129", "0"], // Mustard Yellow
|
36 |
+
["134", "42", "22"], // Brick Red
|
37 |
+
["0", "160", "139"], // Teal
|
38 |
["175", "0", "56"], // Crimson
|
39 |
["108", "124", "50"], // Olive Green
|
40 |
+
["81", "28", "251"], // Royal Blue
|
41 |
+
["218", "22", "255"], // Electric Purple
|
42 |
+
["98", "0", "66"], // Dark Magenta
|
43 |
// ['34', '42', '42'], Black, which makes the text unreadable
|
44 |
+
// ["117", "13", "134"], // Deep Magenta
|
|
|
|
|
45 |
["251", "0", "209"], // Hot Pink
|
46 |
["252", "0", "128"], // Bright Pink
|
47 |
+
// ["178", "130", "141"], // Dusty Pink
|
|
|
48 |
["119", "138", "174"], // Slate Blue
|
|
|
|
|
|
|
49 |
["22", "22", "167"], // Deep Blue
|
50 |
["218", "96", "202"], // Orchid
|
51 |
// ['13', '42', '99'], Black
|
|
|
55 |
|
56 |
|
57 |
export const NAMED_COLORS = {
|
58 |
+
"red": ["251", "13", "13"], // Vivid Red
|
59 |
};
|
60 |
|
61 |
export const getColor = (i, opacity=1) => {
|
src/index.html
CHANGED
@@ -164,7 +164,7 @@
|
|
164 |
<h1 class="l-page" style="text-align: center;">π· FineWeb: decanting the web for the finest text data at scale</h1>
|
165 |
<div id="title-plot" class="main-plot-container l-screen">
|
166 |
<figure>
|
167 |
-
<img src="assets/images/
|
168 |
</figure>
|
169 |
<div id="clusters-plot">
|
170 |
<img src="assets/images/clusters.png" alt="Clusters">
|
|
|
164 |
<h1 class="l-page" style="text-align: center;">π· FineWeb: decanting the web for the finest text data at scale</h1>
|
165 |
<div id="title-plot" class="main-plot-container l-screen">
|
166 |
<figure>
|
167 |
+
<img src="assets/images/clusters.png" alt="FineWeb">
|
168 |
</figure>
|
169 |
<div id="clusters-plot">
|
170 |
<img src="assets/images/clusters.png" alt="Clusters">
|