Skip to content

Commit

Permalink
fix "Preview in LiveCodes" Svelte code
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Dec 13, 2024
1 parent bfd56ae commit 02b825f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .livecodes/svelte.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"activeEditor": "script",
"script": {
"language": "svelte",
"content": "<script>\n import { onMount } from \"svelte\";\n import { race } from \"racing-bars\";\n\n const options = {\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n };\n\n onMount(() => {\n race(\"{{LC::TO_URL(./data/population.csv)}}\", \"#race\", options);\n });\n</script>\n\n<div id=\"race\">Loading...</div>\n\n<style>\n #race {\n height: 80vh;\n }\n</style>\n"
"content": "<script>\n import { onMount } from \"svelte\";\n import { race } from \"racing-bars\";\n\n let options = $state({\n dataTransform: (data) =>\n data.map((d) => ({\n ...d,\n icon: `https://flagsapi.com/${d.code}/flat/64.png`,\n })),\n title: \"World Population\",\n subTitle: \"Country Population in millions\",\n caption: \"Source: World Bank\",\n dateCounter: \"YYYY\",\n showIcons: true,\n labelsPosition: \"outside\",\n });\n\n onMount(() => {\n race(\"{{LC::TO_URL(./data/population.csv)}}\", \"#race\", options);\n });\n</script>\n\n<div id=\"race\">Loading...</div>\n\n<style>\n #race {\n height: 80vh;\n }\n</style>\n"
},
"customSettings": {
"imports": {
Expand Down

0 comments on commit 02b825f

Please sign in to comment.