Skip to content

Commit

Permalink
amys ux name suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Mar 5, 2024
1 parent 319c9dd commit 43d76c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/examples/colorpack.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"name": "color",
"type": "ordinal",
"domain": { "data": "tree", "field": "depth" },
"range": { "scheme": "category20" }
"range": "category"
}
],

Expand Down
19 changes: 15 additions & 4 deletions src/example/Examples.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
$: examples = $exampleStore.examples as any;
$: hiddenExamples = $exampleStore.examples.filter((x: any) => x.hidden);
$: numberHidden = hiddenExamples.length;
const navNameMap = {
svg: "SVG",
vega: "Visualizations (via Vega)",
swatches: "Swatches",
} as any;
const navNameMapRev = Object.keys(navNameMap).reduce((acc, key) => {
acc[navNameMap[key]] = key;
return acc;
}, {} as any);
</script>

<div class="flex flex-col items-center bg-stone-300 px-4 py-2">
Expand Down Expand Up @@ -150,11 +160,12 @@
{/if}
</div>
<Nav
tabs={["svg", "vega", "swatches"]}
isTabSelected={(x) => x === $configStore.exampleRoute}
tabs={Object.values(navNameMap)}
isTabSelected={(x) => navNameMapRev[x] === $configStore.exampleRoute}
selectTab={(x) => {
//@ts-ignore
configStore.setExampleRoute(x);
const val = Object.keys(navNameMapRev).find((key) => key === x);
// @ts-ignore
configStore.setExampleRoute(navNameMapRev[val]);
}}
/>
</div>
Expand Down

0 comments on commit 43d76c6

Please sign in to comment.