Skip to content

Commit

Permalink
Improve scorecard
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 3, 2024
1 parent b39fdf5 commit 3335b23
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/routes/scorecard/Scorecard.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<script lang="ts">
import Button from '$lib/components/Button.svelte'
import Cell from './TableCell.svelte'
import { categories } from './categories'
import { companies } from './companies'
let showExplanation = false
</script>

<label>
<input type="checkbox" bind:checked={showExplanation} />
Show explanations
</label>
<Button on:click={() => (showExplanation = !showExplanation)}>Toggle explanations</Button>

<table class={showExplanation ? 'table--big' : ''}>
<thead>
Expand Down
16 changes: 13 additions & 3 deletions src/routes/scorecard/TableCell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@
}
}
}
function maybeShowTooltip() {
if (!showExplanation) {
showTooltip = true
}
}
function handleClick() {
!showExplanation && (showExplanation = !showExplanation)
}
</script>

<td
on:mouseover={() => (showTooltip = true)}
on:mouseover={maybeShowTooltip}
on:mouseout={() => (showTooltip = false)}
on:focus={() => (showTooltip = true)}
on:focus={maybeShowTooltip}
on:blur={() => (showTooltip = false)}
on:click={() => (showExplanation = !showExplanation)}
on:click={handleClick}
class={showExplanation ? '' : 'enable-tooltips'}
>
{#if title !== undefined}
Expand Down
6 changes: 3 additions & 3 deletions src/routes/scorecard/companies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const companiesSource: Company[] = [
explanation:
// https://corporateeurope.org/en/2023/11/byte-byte
'Microsoft has lobbied to shift the burden of responsibility onto users of AI instead of the ones building the AI.',
score: 3
score: 2
},
deployment: {
explanation:
Expand Down Expand Up @@ -111,7 +111,7 @@ const companiesSource: Company[] = [
// https://pitchbook.com/news/articles/generative-AI-Capitol-Hill-VC
explanation:
"Anthropic has spent (a little) money lobbying, but it's unclear what they are pushing for.",
score: 7
score: 5
},
deployment: {
explanation:
Expand All @@ -135,7 +135,7 @@ const companiesSource: Company[] = [
},
lobby: {
explanation: 'No lobbying as far as we know of yet.',
score: 7
score: 5
},
deployment: {
explanation: 'Not sure tbd',
Expand Down

0 comments on commit 3335b23

Please sign in to comment.