@samizdata/mozaic 0.10.0 → 0.12.0
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/cli/src/index.d.ts +10 -0
- package/cli/src/index.js +4 -0
- package/dist/flags/index.d.ts +16 -0
- package/dist/flags/index.js +16 -0
- package/dist/flags/svgs.d.ts +261 -0
- package/dist/flags/svgs.js +265 -0
- package/dist/guides/AxisX.svelte +40 -12
- package/dist/guides/AxisX.svelte.d.ts +6 -1
- package/dist/guides/ticks.d.ts +5 -0
- package/dist/guides/ticks.js +16 -0
- package/dist/interactive/Tooltip.svelte +10 -3
- package/dist/locale/index.d.ts +8 -0
- package/dist/locale/index.js +10 -0
- package/dist/marks/Beeswarm.svelte +31 -12
- package/dist/marks/Beeswarm.svelte.d.ts +3 -0
- package/dist/marks/Flag.svelte +65 -0
- package/dist/marks/Flag.svelte.d.ts +27 -0
- package/dist/marks/Flags.svelte +69 -0
- package/dist/marks/Flags.svelte.d.ts +45 -0
- package/dist/marks/LineEndLabels.svelte +40 -8
- package/dist/marks/LineEndLabels.svelte.d.ts +4 -1
- package/dist/marks/index.d.ts +2 -0
- package/dist/marks/index.js +2 -0
- package/dist/recipes/ArrowChart.svelte +4 -1
- package/dist/recipes/ArrowChart.svelte.d.ts +2 -0
- package/dist/recipes/BarChart.svelte +101 -17
- package/dist/recipes/BarChart.svelte.d.ts +20 -2
- package/dist/recipes/BarDotChart.svelte +4 -1
- package/dist/recipes/BarDotChart.svelte.d.ts +2 -0
- package/dist/recipes/ColumnChart.svelte +5 -2
- package/dist/recipes/ColumnChart.svelte.d.ts +2 -0
- package/dist/recipes/LineChart.svelte +8 -2
- package/dist/recipes/LineChart.svelte.d.ts +2 -0
- package/dist/recipes/ScatterChart.svelte +177 -17
- package/dist/recipes/ScatterChart.svelte.d.ts +40 -1
- package/dist/recipes/StripChart.svelte +301 -0
- package/dist/recipes/StripChart.svelte.d.ts +89 -0
- package/dist/recipes/index.d.ts +2 -1
- package/dist/recipes/index.js +3 -1
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.js +1 -1
- package/dist/transforms/labels.d.ts +8 -2
- package/dist/transforms/labels.js +35 -7
- package/package.json +11 -1
- package/src/lib/recipes/ArrowChart.svelte +4 -1
- package/src/lib/recipes/BarChart.svelte +101 -17
- package/src/lib/recipes/BarDotChart.svelte +4 -1
- package/src/lib/recipes/ColumnChart.svelte +5 -2
- package/src/lib/recipes/LineChart.svelte +8 -2
- package/src/lib/recipes/ScatterChart.svelte +177 -17
- package/src/lib/recipes/StripChart.svelte +301 -0
- package/src/lib/recipes/index.ts +3 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Browser } from 'playwright-core';
|
|
2
|
+
|
|
3
|
+
/** Chromium executables to try, in order: `explicit`, $MOZAIC_BROWSER, Playwright's, the system's. */
|
|
4
|
+
export function browserCandidates(explicit?: string): string[];
|
|
5
|
+
/** The first Chromium found, or `undefined`. */
|
|
6
|
+
export function findBrowser(explicit?: string): string | undefined;
|
|
7
|
+
/** Launch the first Chromium that starts; with `explicit`, only that one. */
|
|
8
|
+
export function launchBrowser(explicit?: string): Promise<Browser>;
|
|
9
|
+
/** Serve a static folder on 127.0.0.1 at a random port; directories get their index.html. */
|
|
10
|
+
export function serveStatic(dir: string): Promise<{ url: string; close: () => Promise<void> }>;
|
package/cli/src/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// The CLI's building blocks, for scripts that render charts their own way (images for social media, say):
|
|
2
|
+
// `import { launchBrowser, serveStatic } from '@samizdata/mozaic/cli'`.
|
|
3
|
+
export { browserCandidates, findBrowser, launchBrowser } from './browser.js';
|
|
4
|
+
export { serveStatic } from './serve.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Square flags for the `Flag` and `Flags` marks, `Beeswarm`, `BarChart` and `StripChart`, drawn
|
|
3
|
+
* as circles in the style of ggflags. Each export is a country's flag as inner SVG markup on a
|
|
4
|
+
* 512 × 512 viewBox, named by its upper-case ISO 3166-1 alpha-2 code (`MD`, `RO`), plus `EU`,
|
|
5
|
+
* `UN` and Eurostat's `EL` (Greece) and `UK` (United Kingdom).
|
|
6
|
+
*
|
|
7
|
+
* Import only the flags a chart uses, so the others stay out of the bundle:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { MD, RO, UA } from '@samizdata/mozaic/flags';
|
|
11
|
+
* const flags: Record<string, string> = { MD, RO, UA };
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Flags from flag-icons (https://github.com/lipis/flag-icons), MIT License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './svgs.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Square flags for the `Flag` and `Flags` marks, `Beeswarm`, `BarChart` and `StripChart`, drawn
|
|
3
|
+
* as circles in the style of ggflags. Each export is a country's flag as inner SVG markup on a
|
|
4
|
+
* 512 × 512 viewBox, named by its upper-case ISO 3166-1 alpha-2 code (`MD`, `RO`), plus `EU`,
|
|
5
|
+
* `UN` and Eurostat's `EL` (Greece) and `UK` (United Kingdom).
|
|
6
|
+
*
|
|
7
|
+
* Import only the flags a chart uses, so the others stay out of the bundle:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { MD, RO, UA } from '@samizdata/mozaic/flags';
|
|
11
|
+
* const flags: Record<string, string> = { MD, RO, UA };
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Flags from flag-icons (https://github.com/lipis/flag-icons), MIT License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './svgs.js';
|