acoustic-angle-84817
05/17/2023, 5:00 AMbright-smartphone-11251
bright-smartphone-11251
<script lang="ts">
at the top.
With .md
files, I'm less sure. Our markdown processor MDsveX doesn't officially support TS. But I think some people have made it work in other projectsacoustic-angle-84817
05/17/2023, 12:57 PMacoustic-angle-84817
05/17/2023, 12:57 PMbright-smartphone-11251
bright-smartphone-11251
bright-smartphone-11251
acoustic-angle-84817
05/17/2023, 1:00 PMacoustic-angle-84817
05/17/2023, 1:00 PMbright-smartphone-11251
bright-smartphone-11251
acoustic-angle-84817
05/17/2023, 1:04 PMacoustic-angle-84817
05/17/2023, 1:05 PMbright-smartphone-11251
bright-smartphone-11251
acoustic-angle-84817
05/17/2023, 1:10 PMbland-thailand-4711
05/17/2023, 1:15 PMacoustic-angle-84817
05/17/2023, 1:16 PMacoustic-angle-84817
05/17/2023, 1:16 PMacoustic-angle-84817
05/17/2023, 1:17 PMbland-thailand-4711
05/17/2023, 1:17 PMI also might need to add the typescript preprocessor to the svelte.config file which Evidence definesThis may be a solution, but would not be a simple task because that file is re-written whenever you build. I have a few ideas, just don't want to jump straight to the more complex ones 😅
bland-thailand-4711
05/17/2023, 1:17 PMacoustic-angle-84817
05/17/2023, 1:23 PMlang="ts"
3. Get typescript error (assumes you are using VSCode configured with the typescript language server, in which case you’ll see the errors in the editor)
Full error example:
Cannot find module '$lib/viz/BarChart.svelte' or its corresponding type declarations.
Something like components/MyComponent.svelte
<script lang="ts">
import BarChart from '$lib/viz/BarChart.svelte';
</script>
bland-thailand-4711
05/17/2023, 1:25 PMbland-thailand-4711
05/17/2023, 1:25 PMtsconfig.json
?acoustic-angle-84817
05/17/2023, 1:26 PMacoustic-angle-84817
05/17/2023, 1:26 PM{
"extends": "@tsconfig/svelte/tsconfig.json",
"include": [
"components/**/*",
"src/node_modules"
],
"exclude": [
"node_modules/*",
"build/*",
"sources/*",
"pages/*"
],
"compilerOptions": {
"moduleResolution": "node"
}
}
acoustic-angle-84817
05/17/2023, 1:26 PMbland-thailand-4711
05/17/2023, 1:29 PM$lib
in a different place than we have assigned svelte's $lib
. Let me take a lookbright-smartphone-11251
acoustic-angle-84817
05/17/2023, 1:30 PMbland-thailand-4711
05/17/2023, 1:30 PM./.svelte-kit/tsconfig.json
?acoustic-angle-84817
05/17/2023, 1:31 PMacoustic-angle-84817
05/17/2023, 1:33 PMpaths
values?bland-thailand-4711
05/17/2023, 1:33 PMbland-thailand-4711
05/17/2023, 1:33 PM./.evidence/template/src/components
acoustic-angle-84817
05/17/2023, 1:34 PMacoustic-angle-84817
05/17/2023, 1:34 PMacoustic-angle-84817
05/17/2023, 1:34 PM"compilerOptions": {
"moduleResolution": "node",
"paths": {
"$lib": [
".evidence/template/src/components"
],
"$lib/*": [
".evidence/template/src/components/*"
]
},
}
acoustic-angle-84817
05/17/2023, 1:34 PMbright-smartphone-11251
acoustic-angle-84817
05/17/2023, 1:35 PMbland-thailand-4711
05/17/2023, 1:36 PMacoustic-angle-84817
05/17/2023, 1:37 PMbland-thailand-4711
05/17/2023, 1:40 PMbland-thailand-4711
05/17/2023, 1:40 PMacoustic-angle-84817
05/17/2023, 1:47 PMacoustic-angle-84817
05/17/2023, 1:50 PMbright-smartphone-11251
acoustic-angle-84817
05/17/2023, 1:56 PMacoustic-angle-84817
05/17/2023, 2:07 PM<WrappedChart
query={`
SELECT
COUNT(DISTINCT redacted1) AS redacted2,
redacted3
FROM ?
GROUP BY redacted3
ORDER BY redacted3
`}
queryParams={[datasetCurrTimePeriod_full]}
title="Participation by Redacted3"
subtitle="Short subtitle to help explain the data"
showTitleMenu=true
x=redacted3
y=redacted2
swapXY=true
chartType=bar
/>
bland-thailand-4711
05/17/2023, 2:20 PMacoustic-angle-84817
05/17/2023, 2:21 PMacoustic-angle-84817
05/17/2023, 2:21 PMswift-architect-88465
05/17/2023, 6:04 PMswift-architect-88465
05/17/2023, 6:06 PMacoustic-angle-84817
05/17/2023, 9:36 PMbright-smartphone-11251
buttons, menus, drop-down high arity text menus based on data etc. dynamic grouping
is on the relatively near term roadmap - we imagine most of this will be unlocked with DuckDB as a in browser query engine.
Manipulating URL params is possible but a bit hacky right now: https://docs.evidence.dev/core-concepts/filters/, and definitely something we aim to improve.