Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Feb 20, 2024
1 parent 09d76fc commit aa0fe7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
32 changes: 0 additions & 32 deletions src/content-modules/Browse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@
import type { PaletteWrap } from "../stores/example-palette-store";
import type { LintResult } from "../lib/ColorLint";
import PalPreview from "../components/PalPreview.svelte";
import MiniPalPreview from "../components/MiniPalPreview.svelte";
import LintCustomizationModal from "../linting/LintCustomizationModal.svelte";
import { lint } from "../lib/api-calls";
import Tooltip from "../components/Tooltip.svelte";
import { debounce } from "vega";
import { buttonStyle } from "../lib/styles";
// let lintCache: Record<number, false | any[]> = Object.fromEntries(
// $examplePalStore.palettes.map((_, idx) => [idx, false])
// );
onMount(async () => {
// wait for the palettes to be loaded
while ($examplePalStore.palettes.length === 0) {
Expand All @@ -37,32 +31,6 @@
});
}
// $: updateSearchDebounced = debounce(2000, async () => {
// // for (let idx = 0; idx < $examplePalStore.palettes.length; idx++) {
// // const pal = $examplePalStore.palettes[idx];
// // console.log("linting", pal.palette.name);
// // const res = await lint(pal.palette, false);
// // lintCache[idx] = res;
// // }
// $examplePalStore.palettes.forEach(async (pal, index) => {
// lint(pal.palette, false).then((res) => {
// examplePalStore.postLint(index, res);
// });
// });
// });
// $: updateSearchDebounced();
$: groupsByTypes = $examplePalStore.palettes.reduce(
(acc, pal, idx) => {
if (acc[pal.palette.type]) {
acc[pal.palette.type].push([idx, pal]);
} else {
acc[pal.palette.type] = [[idx, pal]];
}
return acc;
},
{} as Record<string, [number, PaletteWrap][]>
);
// todo add the local ones as well
const lintMarks = {
pass: "",
Expand Down
9 changes: 1 addition & 8 deletions src/stores/example-palette-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,7 @@ export const VegaColors = {
tableau20:
"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",
accent: "7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",
// dark2: "1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",
// paired:
// "a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",
// pastel1: "fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",
// pastel2: "b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",
set1: "e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",
// set2: "66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",
// set3: "8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f",
};

async function buildAllExamples(): Promise<PaletteWrap[]> {
Expand Down Expand Up @@ -76,7 +69,7 @@ const storeName = "color-buddy-example-palettes";

function serializeStore(store: StoreData) {
const outputStore = { ...store } as any;
outputStore.palettes = outputStore.palettes.map((x) => {
outputStore.palettes = outputStore.palettes.map((x: any) => {
const palette = x.palette;
return {
palette: {
Expand Down

0 comments on commit aa0fe7d

Please sign in to comment.