|
|
|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
<title>fka/awesome-chatgpt-prompts</title> |
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com"> |
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
|
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> |
|
|
|
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" /> |
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" /> |
|
<script src="https://unpkg.com/deck.gl@latest/dist.min.js"></script> |
|
|
|
<script src="https://unpkg.com/[email protected]"></script> |
|
|
|
<style> |
|
body { |
|
margin: 0; |
|
padding: 0; |
|
overflow: hidden; |
|
background: #ffffff; |
|
} |
|
|
|
#deck-container { |
|
width: 100vw; |
|
height: 100vh; |
|
} |
|
|
|
#deck-container canvas { |
|
z-index: 1; |
|
background: #ffffff; |
|
} |
|
|
|
.deck-tooltip { |
|
|
|
font-size: 0.8em; |
|
font-family: Roboto; |
|
font-weight: 300; |
|
color: #000000 !important; |
|
background-color: #ffffffaa !important; |
|
border-radius: 12px; |
|
box-shadow: 2px 3px 10px #aaaaaa44; |
|
max-width: 25%; |
|
} |
|
|
|
#loading { |
|
width: 100%; |
|
height: 100%; |
|
top: 0px; |
|
left: 0px; |
|
position: absolute; |
|
display: block; |
|
z-index: 99 |
|
} |
|
|
|
#loading-image { |
|
position: absolute; |
|
top: 45%; |
|
left: 47.5%; |
|
z-index: 100 |
|
} |
|
|
|
#title-container { |
|
position: absolute; |
|
top: 0; |
|
left: 0; |
|
margin: 16px; |
|
padding: 12px; |
|
border-radius: 16px; |
|
line-height: 0.95; |
|
z-index: 2; |
|
font-family: Roboto; |
|
color: #000000; |
|
background: #ffffffaa; |
|
box-shadow: 2px 3px 10px #aaaaaa44; |
|
} |
|
|
|
|
|
#search-container{ |
|
position: absolute; |
|
left: -16px; |
|
margin: 16px; |
|
padding: 12px; |
|
border-radius: 16px; |
|
z-index: 2; |
|
font-family: Roboto; |
|
color: #000000; |
|
background: #ffffffaa; |
|
width: fit-content; |
|
box-shadow: 2px 3px 10px #aaaaaa44; |
|
} |
|
input { |
|
margin: 2px; |
|
padding: 4px; |
|
border-radius: 8px; |
|
color: #000000; |
|
background: #ffffffdd; |
|
border: 1px solid #ddddddff; |
|
transition: 0.5s; |
|
outline: none; |
|
} |
|
input:focus { |
|
border: 2px solid #555; |
|
} |
|
|
|
|
|
</style> |
|
</head> |
|
<body> |
|
<div id="loading"> |
|
<img id="loading-image" src="https://i.gifer.com/ZKZg.gif" alt="Loading..." width="5%"/> |
|
</div> |
|
|
|
<div id="title-container"> |
|
<span style="font-family:Roboto;font-size:36pt;color:#000000"> |
|
fka/awesome-chatgpt-prompts |
|
</span><br/> |
|
<span style="font-family:Roboto;font-size:18pt;color:#777777"> |
|
Data map for the entire <a href='https://huggingface.co/datasets/fka/awesome-chatgpt-prompts/viewer/default/train' target='_blank'>dataset</a> (170 rows) using the column 'act' |
|
</span> |
|
|
|
<div id="search-container"> |
|
<input autocomplete="off" type="search" id="search" placeholder="🔍"> |
|
</div> |
|
|
|
</div> |
|
|
|
|
|
<div id="deck-container"> |
|
</div> |
|
|
|
</body> |
|
<script type="module"> |
|
import { ArrowLoader } from 'https://cdn.jsdelivr.net/npm/@loaders.gl/[email protected]/+esm' |
|
import { JSONLoader } from 'https://cdn.jsdelivr.net/npm/@loaders.gl/[email protected]/+esm' |
|
|
|
|
|
|
|
const pointDataBase64 = "QVJST1cxAAD/////0AUAABAAAAAAAAoADgAGAAUACAAKAAAAAAEEABAAAAAAAAoADAAAAAQACAAKAAAASAQAAAQAAAABAAAADAAAAAgADAAEAAgACAAAACAEAAAEAAAAEAQAAHsiaW5kZXhfY29sdW1ucyI6IFt7ImtpbmQiOiAicmFuZ2UiLCAibmFtZ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UiOiAiYSIsICJmaWVsZF9uYW1lIjogImEiLCAicGFuZGFzX3R5cGUiOiAidWludDgiLCAibnVtcHlfdHlwZSI6ICJ1aW50OCIsICJtZXRhZGF0YSI6IG51bGx9LCB7Im5hbWUiOiAic2VsZWN0ZWQiLCAiZmllbGRfbmFtZSI6ICJzZWxlY3RlZCIsICJwYW5kYXNfdHlwZSI6ICJ1aW50OCIsICJudW1weV90eXBlIjogInVpbnQ4IiwgIm1ldGFkYXRhIjogbnVsbH1dLCAiY3JlYXRvciI6IHsibGlicmFyeSI6ICJweWFycm93IiwgInZlcnNpb24iOiAiMTcuMC4wIn0sICJwYW5kYXNfdmVyc2lvbiI6ICIyLjIuMiJ9AAAAAAYAAABwYW5kYXMAAAcAAAAoAQAA7AAAALwAAACQAAAAZAAAADgAAAAEAAAABP///wAAAQIQAAAAHAAAAAQAAAAAAAAACAAAAHNlbGVjdGVkAAAAAGL///8IAAAANP///wAAAQIQAAAAFAAAAAQAAAAAAAAAAQAAAGEAAACK////CAAAAFz///8AAAECEAAAABQAAAAEAAAAAAAAAAEAAABiAAAAsv///wgAAACE////AAABAhAAAAAUAAAABAAAAAAAAAABAAAAZwAAANr///8IAAAArP///wAAAQIQAAAAGAAAAAQAAAAAAAAAAQAAAHIABgAIAAQABgAAAAgAAADY////AAABAxAAAAAUAAAABAAAAAAAAAABAAAAeQAAAMr///8AAAEAEAAUAAgABgAHAAwAAAAQABAAAAAAAAEDEAAAABgAAAAEAAAAAAAAAAEAAAB4AAYACAAGAAYAAAAAAAEA+AUAAEFSUk9XMQ=="; |
|
const pointDataBuffer = fflate.strToU8(atob(pointDataBase64), true); |
|
const pointData = await loaders.parse(pointDataBuffer, ArrowLoader); |
|
const hoverDataBase64 = "H4sIAAiXH2cC/+2YX4hcVx3Hb5o/TWKqEdtQxNLDIrZVN39ESKgPOrs7u9k4m0x2JkmjlOTMnTMzJ3vvPbfnnru7tyGKQgWhD32wVKxC64NKEFoQfRDji0WL+JJCxYegUFChmIIgio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0yy0m0bq0BVsgyQZUvKB+6f8VvlCrE3cJf5I6WEhKuiY4ZuA3K0rTe+dKoYlllzKoaqs0t8taIfet5soBm4uogq7aoK6NSS367VwUH0NDKOPaubLmo45c+w6kyiMyGaJvMNWNzRW9xrn2yvXVAM1aWWkcSrKosJYOUd2mAr6WEkUzkM7isA5FM1sQFY9cyf3ZmWyrB2NWzXp+UcuphzoohLilfrro6pHCBqUpNG/VtGNufTnFabYgWz1Q5STDOF19t57j99+ejSny1W7RlRvW33CuYyB8hkhyvQ9rxj2Bocbmv5BYT8W2oeqb3SCbKQ8MnJ2O4DYiiycILytcJrmavs7SUkD9tNBWYHfFXTCacH2k1QBvKp+u6EmcG5ClFQ0sfl+l10yOMjCEdZieLtZFDXffEo51W+7Gx5WXWtORG4TduW8kVA/AHOZsgUq1ClREtKs7kiFiwOUGq1D/Vmz/rynowObE7bAchD8uzlJSb9/czZMc4axNvWVHpZsD9mT2X+PrqyvOTk2NZxDzmkYeN00uca2u5SMvUwBwzIHxMOZf3+yNJfYl0LHQsY1IoLm2h3+/yoqW+9etisEWT3Di5pXbXa9zn1nDs/QW9ptOyWKa4ekrycKfQ6+dlgsKfyvXTIq6ynDKoZl1VnmR5NHMoXI7qjb8sWr4g8YhZ15Q6h5vJyEuW5ZVMx7mIctfU5Iwuy3BdljNHLRnmSpgB+4aR/XF5IJOc9Pp34swGtk8OINqiupzUz2r+eTKonwkP8FS5p3ySPFg9S/LUeIL3jwbT/1ds1s+BL9Xjp8+Z7/2f473/c/z//s/xHDprlP9j+w8RrjezahMAAA=="; |
|
const hoverDataBuffer = fflate.strToU8(atob(hoverDataBase64), true); |
|
const unzippedHoverData = fflate.gunzipSync(hoverDataBuffer); |
|
const hoverData = await loaders.parse(unzippedHoverData, ArrowLoader); |
|
const labelDataBase64 = "H4sIAAiXH2cC/2XRwW7bMAwG4FcxdPYEU5Qo0tceehpQYLnNO6iNlghz5EB2i3bD3n2KjSApdjEMCdD38+f3P+pd9aAZHHYETL5VH6r/wprYgrXikVs1huc4ql49TOHlmPKhCXk/5K8xL2Fsvv1K4zgPeVdCyvVStWpOv2N9lXXXqlJ/qFUH1fv69rPqXT0Mqif7t11xox0ACyA52HCvO2YvHQvSHV5iWNJbHPK5TD/jPKcph3G+caLFd06k8w4390JVWGiFyX2GURvwACJozAZbDcYC1Q/aG/xUpkMJp1OdbcgPx7A8Pu2aeng6LzfdgEZ0COKB7aYbWHXCVWf8rFvtXQeCTpxcx7bOkjeIdDf2Lr4cm5T3r/NSPoZcpjHOW//x/RzLkuZ4C4Ea2TvHCJeyawj2WwOyZgCU/yqoW0aydf9bCNJUS0FmMvchSniLY/P4mvZ32nW/tCFwKe2iGHtVfvwD8aXOZWACAAA="; |
|
const labelDataBuffer = fflate.strToU8(atob(labelDataBase64), true); |
|
const unzippedLabelData = fflate.gunzipSync(labelDataBuffer); |
|
const labelData = await loaders.parse(unzippedLabelData, JSONLoader); |
|
|
|
|
|
const DATA = {src: pointData.data, length: pointData.data.x.length} |
|
|
|
const container = document.getElementById('deck-container'); |
|
const pointLayer = new deck.ScatterplotLayer({ |
|
id: 'dataPointLayer', |
|
data: DATA, |
|
getPosition: (object, {index, data}) => { |
|
return [data.src.x[index], data.src.y[index]]; |
|
}, |
|
|
|
getRadius: 0.1, |
|
|
|
getFillColor: (object, {index, data}) => { |
|
return [ |
|
data.src.r[index], |
|
data.src.g[index], |
|
data.src.b[index], |
|
180 |
|
] |
|
}, |
|
getLineColor: (object, {index, data}) => { |
|
return [ |
|
data.src.r[index], |
|
data.src.g[index], |
|
data.src.b[index], |
|
32 |
|
] |
|
}, |
|
getLineColor: [250, 250, 250, 128], |
|
getLineWidth: 0.001, |
|
highlightColor: [170, 0, 0, 187], |
|
lineWidthMaxPixels: 8, |
|
lineWidthMinPixels: 0.1, |
|
radiusMaxPixels: 24, |
|
radiusMinPixels: 0.01, |
|
radiusUnits: "common", |
|
lineWidthUnits: "common", |
|
autoHighlight: true, |
|
pickable: true, |
|
stroked: true |
|
}); |
|
const labelLayer = new deck.TextLayer({ |
|
id: "textLabelLayer", |
|
data: labelData, |
|
pickable: false, |
|
getPosition: d => [d.x, d.y], |
|
getText: d => d.label, |
|
getColor: d => [d.r, d.g, d.b], |
|
getSize: d => d.size, |
|
sizeScale: 1, |
|
sizeMinPixels: 18, |
|
sizeMaxPixels: 36, |
|
outlineWidth: 8, |
|
outlineColor: [238, 238, 238, 221], |
|
getBackgroundColor: [255, 255, 255, 64], |
|
getBackgroundPadding: [15, 15, 15, 15], |
|
background: true, |
|
characterSet: "auto", |
|
fontFamily: "Roboto", |
|
fontWeight: 900, |
|
lineHeight: 0.95, |
|
fontSettings: {"sdf": true}, |
|
getTextAnchor: "middle", |
|
getAlignmentBaseline: "center", |
|
lineHeight: 0.95, |
|
elevation: 100, |
|
|
|
collisionEnabled: true, |
|
getCollisionPriority: d => d.size, |
|
collisionTestProps: { |
|
sizeScale: 3, |
|
sizeMaxPixels: 36 * 2, |
|
sizeMinPixels: 18 * 2 |
|
}, |
|
extensions: [new deck.CollisionFilterExtension()], |
|
}); |
|
|
|
|
|
const deckgl = new deck.DeckGL({ |
|
container: container, |
|
initialViewState: { |
|
latitude: -6.65933, |
|
longitude: 3.324492, |
|
zoom: 6.303690531098351 |
|
}, |
|
controller: true, |
|
|
|
layers: [pointLayer, labelLayer], |
|
|
|
|
|
getTooltip: ({index}) => hoverData.data.hover_text[index] |
|
}); |
|
|
|
document.getElementById("loading").style.display = "none"; |
|
|
|
|
|
function selectPoints(item, conditional) { |
|
var layerId; |
|
if (item) { |
|
for (var i = 0; i < DATA.length; i++) { |
|
if (conditional(i)) { |
|
DATA.src.selected[i] = 1; |
|
} else { |
|
DATA.src.selected[i] = 0; |
|
} |
|
} |
|
layerId = 'selectedPointLayer' + item; |
|
} else { |
|
for (var i = 0; i < DATA.length; i++) { |
|
DATA.src.selected[i] = 1; |
|
} |
|
layerId = 'dataPointLayer'; |
|
} |
|
const selectedPointLayer = pointLayer.clone( |
|
{ |
|
id: layerId, |
|
data: DATA, |
|
getFilterValue: (object, {index, data}) => data.src.selected[index], |
|
filterRange: [1, 2], |
|
extensions: [new deck.DataFilterExtension({filterSize: 1})] |
|
} |
|
); |
|
deckgl.setProps( |
|
{layers: |
|
[selectedPointLayer].concat(deckgl.props.layers.slice(1,)) |
|
} |
|
); |
|
} |
|
|
|
const search = document.getElementById("search"); |
|
search.addEventListener("input", (event) => { |
|
const search_term = event.target.value.toLowerCase(); |
|
selectPoints(search_term, (i) => hoverData.data.hover_text[i].toLowerCase().includes(search_term)); |
|
} |
|
); |
|
|
|
|
|
</script> |
|
</html> |