Skip to content

Commit 1c2236a

Browse files
committed
Add files
1 parent 27b5400 commit 1c2236a

16 files changed

+227
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Env
16+
.env
17+
.env.*
18+
!.env.example
19+
!.env.test
20+
21+
# Vite
22+
vite.config.js.timestamp-*
23+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,43 @@
11
# svelteplot-demos
2+
23
Svelteplot demos
4+
5+
---
6+
7+
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
8+
9+
## Creating a project
10+
11+
If you're seeing this, you've probably already done this step. Congrats!
12+
13+
```bash
14+
# create a new project in the current directory
15+
npx sv create
16+
17+
# create a new project in my-app
18+
npx sv create my-app
19+
```
20+
21+
## Developing
22+
23+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
24+
25+
```bash
26+
npm run dev
27+
28+
# or start the server and open the app in a new browser tab
29+
npm run dev -- --open
30+
```
31+
32+
## Building
33+
34+
To create a production version of your app:
35+
36+
```bash
37+
npm run build
38+
```
39+
40+
You can preview the production build with `npm run preview`.
41+
42+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
43+

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import prettier from 'eslint-config-prettier';
2+
import js from '@eslint/js';
3+
import { includeIgnoreFile } from '@eslint/compat';
4+
import svelte from 'eslint-plugin-svelte';
5+
import globals from 'globals';
6+
import { fileURLToPath } from 'node:url';
7+
import svelteConfig from './svelte.config.js';
8+
9+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
10+
11+
export default [
12+
includeIgnoreFile(gitignorePath),
13+
js.configs.recommended,
14+
...svelte.configs.recommended,
15+
prettier,
16+
...svelte.configs.prettier,
17+
{
18+
languageOptions: {
19+
globals: { ...globals.browser, ...globals.node }
20+
}
21+
},
22+
{
23+
files: ['**/*.svelte', '**/*.svelte.js'],
24+
languageOptions: { parserOptions: { svelteConfig } }
25+
}
26+
];

jsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"checkJs": false,
6+
"moduleResolution": "bundler"
7+
}
8+
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
9+
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
10+
//
11+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
12+
// from the referenced tsconfig.json - TypeScript does not merge them in
13+
}

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "svelteplot-demos",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build",
9+
"preview": "vite preview",
10+
"prepare": "svelte-kit sync || echo ''",
11+
"format": "prettier --write .",
12+
"lint": "prettier --check . && eslint ."
13+
},
14+
"devDependencies": {
15+
"@eslint/compat": "^1.2.5",
16+
"@eslint/js": "^9.18.0",
17+
"@sveltejs/adapter-auto": "^6.0.0",
18+
"@sveltejs/kit": "^2.16.0",
19+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
20+
"eslint": "^9.18.0",
21+
"eslint-config-prettier": "^10.0.1",
22+
"eslint-plugin-svelte": "^3.0.0",
23+
"globals": "^16.0.0",
24+
"prettier": "^3.4.2",
25+
"prettier-plugin-svelte": "^3.3.3",
26+
"svelte": "^5.0.0",
27+
"svelteplot": "^0.2.4",
28+
"vite": "^6.2.6",
29+
"d3-dsv": "^3.0.1"
30+
}
31+
}

src/app.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div style="display: contents">%sveltekit.body%</div>
11+
</body>
12+
</html>

src/lib/bears.csv.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { csvParse, autoType } from 'd3-dsv';
2+
export default csvParse(`name,count
3+
Polar,35
4+
Brown,112`, autoType)

0 commit comments

Comments
 (0)