svelteplot 0.4.3-pr-199.6 → 0.4.3-pr-199.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/marks/helpers/MultilineText.svelte +10 -10
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -5,3 +5,44 @@
|
|
|
5
5
|
SveltePlot is a visualization framework based on the [layered grammar of graphics](https://vita.had.co.nz/papers/layered-grammar.html) ideas. It's API is heavily inspired by [Observable Plot](https://github.com/observablehq/plot). Created by Gregor Aisch.
|
|
6
6
|
|
|
7
7
|
<img src="static/logo.png" alt="SveltePlot logo" width="401" />
|
|
8
|
+
|
|
9
|
+
## Development
|
|
10
|
+
|
|
11
|
+
Clone the repo and install dependencies:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone git@github.com:svelteplot/svelteplot.git
|
|
15
|
+
cd svelteplot
|
|
16
|
+
pnpm install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run the development server:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Open http://localhost:5173 in your browser.
|
|
26
|
+
|
|
27
|
+
## Testing
|
|
28
|
+
|
|
29
|
+
Run unit tests:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm lint
|
|
33
|
+
pnpm test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
You should also run the visual regression tests:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm test:visual
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This will generate screenshots and compare them with the expected results.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm vi:report
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
To see the differences side by side you can open http://localhost:5173/\_\_vr/report.html
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
: [
|
|
56
56
|
args.x != null
|
|
57
57
|
? d.x
|
|
58
|
-
: isLeft
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
: (isLeft
|
|
59
|
+
? plot.options.marginLeft
|
|
60
|
+
: isRight
|
|
61
|
+
? plot.options.marginLeft + plot.facetWidth
|
|
62
|
+
: plot.options.marginLeft + plot.facetWidth * 0.5) + (d.dx ?? 0),
|
|
63
63
|
args.y != null
|
|
64
64
|
? d.y
|
|
65
|
-
: isTop
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
: (isTop
|
|
66
|
+
? plot.options.marginTop
|
|
67
|
+
: isBottom
|
|
68
|
+
? plot.options.marginTop + plot.facetHeight
|
|
69
|
+
: plot.options.marginTop + plot.facetHeight * 0.5) + (d.dy ?? 0)
|
|
70
70
|
]
|
|
71
71
|
);
|
|
72
72
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelteplot",
|
|
3
|
-
"version": "0.4.3-pr-199.
|
|
3
|
+
"version": "0.4.3-pr-199.8",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Gregor Aisch",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"preview": "vite preview",
|
|
13
13
|
"test": "npm run test:unit",
|
|
14
14
|
"test:visual": "node scripts/visual-regression.js",
|
|
15
|
+
"vr:report": "node scripts/vr-report.js",
|
|
15
16
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
16
17
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
17
18
|
"lint": "prettier --check src && eslint src",
|