Skip to content

Commit

Permalink
quick fix for cluster titles
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorchard committed May 15, 2024
1 parent b0a1427 commit 54649cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script type="module" src="./index.js"></script>
</head>
<body>
<sticky-notes-canvas id="notes-canvas" zoom="0.25" originX="0" originY="0">
<sticky-notes-canvas id="notes-canvas" zoom="1.0" originX="0" originY="0">
</sticky-notes-canvas>
</body>
</html>
9 changes: 7 additions & 2 deletions public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ async function main() {
for (let i = 0; i < clusters.length; i++) {
const cluster = clusters[i];

const prompt = PROMPT_TEMPLATE(SYSTEM_PROMPT, USER_PROMPT(cluster));
const prompt = PROMPT_TEMPLATE(
SYSTEM_PROMPT,
USER_PROMPT(cluster.map((item) => item.item))
);
const result = await llamafile("completion", {
prompt,
n_predict: 16,
Expand All @@ -76,7 +79,9 @@ async function main() {
id: `cluster-${i}`,
x: clusterX,
y: clusterY,
title: `${result.content}`,
width: 150,
height: 125,
title: `${result.content.trim()}`,
color: `#999`,
children: cluster.map((item) =>
createElement("sticky-notes-cluster-link", {
Expand Down
2 changes: 1 addition & 1 deletion public/lib/components/StickyNotesCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class StickyNotesCanvas extends DraggableMixin(BaseElement) {
if (!el) continue;

if (el.tagName === "STICKY-NOTES-CLUSTER-TOPIC") {
point.m = 100000;
point.m = 10000;
} else {
point.m = 1;
}
Expand Down
7 changes: 2 additions & 5 deletions public/lib/components/StickyNotesClusterTopic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ export class StickyNotesClusterTopic extends StickyNotesCanvasChildDraggableMixi
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
border: 1px solid black;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
z-index: -100;
}
:host .container {
}
</style>
<div class="container">
<span class="title"></span>
</div>
<span class="title"></span>
`;

update() {
Expand Down

0 comments on commit 54649cd

Please sign in to comment.