svelteplot 0.0.1-alpha.6 → 0.0.1-alpha.7
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/dist/Plot.svelte +1 -5
- package/dist/Plot.svelte.d.ts +1 -1
- package/dist/classes/Channel.svelte.js +1 -1
- package/dist/helpers/GroupMultiple.svelte.d.ts +1 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/getBaseStyles.d.ts +1 -1
- package/dist/helpers/isDataRecord.d.ts +1 -1
- package/dist/helpers/typeChecks.d.ts +1 -1
- package/dist/helpers/wrapArray.d.ts +2 -2
- package/dist/marks/AxisX.svelte.d.ts +1 -1
- package/dist/marks/AxisY.svelte.d.ts +1 -1
- package/dist/marks/BaseMark.svelte.d.ts +1 -1
- package/dist/marks/ColorLegend.svelte +25 -23
- package/dist/marks/Dot.svelte +4 -4
- package/dist/marks/Dot.svelte.d.ts +1 -1
- package/dist/marks/DotX.svelte.d.ts +1 -1
- package/dist/marks/DotY.svelte.d.ts +1 -1
- package/dist/marks/Frame.svelte.d.ts +2 -2
- package/dist/marks/GridX.svelte +1 -1
- package/dist/marks/GridX.svelte.d.ts +4 -4
- package/dist/marks/GridY.svelte.d.ts +1 -1
- package/dist/marks/Line.svelte.d.ts +1 -1
- package/dist/marks/LineX.svelte.d.ts +1 -1
- package/dist/marks/LineY.svelte.d.ts +1 -1
- package/dist/marks/RuleX.svelte.d.ts +1 -1
- package/dist/marks/RuleY.svelte.d.ts +1 -1
- package/dist/marks/SymbolLegend.svelte +16 -16
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/Plot.svelte
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<script>import { setContext } from "svelte";
|
|
2
|
-
import { Frame, GridX, GridY } from "./";
|
|
2
|
+
import { Frame, GridX, GridY, AxisX, AxisY, ColorLegend, SymbolLegend } from "./index.js";
|
|
3
3
|
import { DEFAULT_PLOT_OPTIONS, Plot } from "./classes/Plot.svelte";
|
|
4
4
|
import mergeDeep from "./helpers/mergeDeep.js";
|
|
5
|
-
import AxisX from "./marks/AxisX.svelte";
|
|
6
|
-
import AxisY from "./marks/AxisY.svelte";
|
|
7
|
-
import ColorLegend from "./marks/ColorLegend.svelte";
|
|
8
|
-
import SymbolLegend from "./marks/SymbolLegend.svelte";
|
|
9
5
|
let {
|
|
10
6
|
// snippets
|
|
11
7
|
header,
|
package/dist/Plot.svelte.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import resolveChannel from '../helpers/resolveChannel.js';
|
|
2
2
|
import { extent } from 'd3-array';
|
|
3
|
-
import { MARK_PROP_CHANNEL
|
|
3
|
+
import { MARK_PROP_CHANNEL } from '../contants.js';
|
|
4
4
|
import { isBooleanOrNull, isColorOrNull, isDateOrNull, isNumberOrNull, isStringOrNull } from '../helpers/typeChecks.js';
|
|
5
5
|
import { uniq } from 'underscore';
|
|
6
6
|
export class Channel {
|
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { interpolateBrBG } from 'd3-scale-chromatic';
|
|
2
|
-
import type { ColorScheme } from '../types';
|
|
2
|
+
import type { ColorScheme } from '../types.js';
|
|
3
3
|
export declare const categoricalSchemes: Map<string, readonly string[]>;
|
|
4
4
|
export declare function isCategoricalScheme(scheme: string): boolean;
|
|
5
5
|
type SchemeGetter = (n: number) => readonly string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ChannelAccessor, MarkStyleProps, DataRow } from '../types';
|
|
1
|
+
import type { ChannelAccessor, MarkStyleProps, DataRow } from '../types.js';
|
|
2
2
|
export default function (datum: DataRow, props: Partial<Record<MarkStyleProps, ChannelAccessor>>): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DataRecord } from '../types';
|
|
1
|
+
import type { DataRecord } from '../types.js';
|
|
2
2
|
export default function (value: any): value is DataRecord;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RawValue } from '../types';
|
|
1
|
+
import type { RawValue } from '../types.js';
|
|
2
2
|
export declare function isBooleanOrNull(v: RawValue): boolean;
|
|
3
3
|
export declare function isDateOrNull(v: RawValue): boolean;
|
|
4
4
|
export declare function isNumberOrNull(v: RawValue): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DataRow } from '../types';
|
|
2
|
-
export default function (data: DataRow[]): (Date | [number, number] | import("../types").DataRecord)[];
|
|
1
|
+
import type { DataRow } from '../types.js';
|
|
2
|
+
export default function (data: DataRow[]): (Date | [number, number] | import("../types.js").DataRecord)[];
|
|
@@ -5,29 +5,29 @@ const plot = getContext("svelteplot");
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
{#if plot.color.manualActiveMarks.length > 0}
|
|
8
|
-
<div class="color-legend">
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
<div class="color-legend">
|
|
9
|
+
{#each plot.colorScale.domain() as value}
|
|
10
|
+
{@const symbolV = plot.symbolScale(value)}
|
|
11
|
+
{@const symbolType = maybeSymbol(symbolV)}
|
|
12
|
+
<div class="item">
|
|
13
|
+
<div class="swatch">
|
|
14
|
+
<svg width="15" height="15"
|
|
15
|
+
>{#if plot.colorSymbolRedundant}
|
|
16
|
+
<path
|
|
17
|
+
transform="translate(7.5,7.5)"
|
|
18
|
+
fill={plot.hasFilledDotMarks ? plot.colorScale(value) : 'none'}
|
|
19
|
+
stroke={plot.hasFilledDotMarks ? null : plot.colorScale(value)}
|
|
20
|
+
d={d3Symbol(symbolType, 40)()}
|
|
21
|
+
/>
|
|
22
|
+
{:else}
|
|
23
|
+
<rect fill={plot.colorScale(value)} width="15" height="15" />
|
|
24
|
+
{/if}</svg
|
|
25
|
+
>
|
|
26
|
+
</div>
|
|
27
|
+
<span class="item-label">{value}</span>
|
|
26
28
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{/each}
|
|
30
|
-
</div>
|
|
29
|
+
{/each}
|
|
30
|
+
</div>
|
|
31
31
|
{/if}
|
|
32
32
|
|
|
33
33
|
<style>
|
|
@@ -40,7 +40,9 @@ const plot = getContext("svelteplot");
|
|
|
40
40
|
.item {
|
|
41
41
|
margin: 0 1em 0.5ex 0;
|
|
42
42
|
}
|
|
43
|
-
path {
|
|
43
|
+
path {
|
|
44
|
+
stroke-width: 1.5;
|
|
45
|
+
}
|
|
44
46
|
.item,
|
|
45
47
|
.item-label,
|
|
46
48
|
.swatch {
|
package/dist/marks/Dot.svelte
CHANGED
|
@@ -30,10 +30,10 @@ function isValid(value) {
|
|
|
30
30
|
{data}
|
|
31
31
|
channels={[
|
|
32
32
|
...(x ? ['x'] : []),
|
|
33
|
-
...(y ? ['y'] : []),
|
|
34
|
-
...(r ? ['radius'] : []),
|
|
35
|
-
...(symbol ? ['symbol'] : []),
|
|
36
|
-
...(fill || stroke ? ['color']: [])
|
|
33
|
+
...(y ? ['y'] : []),
|
|
34
|
+
...(r ? ['radius'] : []),
|
|
35
|
+
...(symbol ? ['symbol'] : []),
|
|
36
|
+
...(fill || stroke ? ['color'] : [])
|
|
37
37
|
]}
|
|
38
38
|
{x}
|
|
39
39
|
{y}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { FrameProps } from '../types';
|
|
2
|
+
import type { FrameProps } from '../types.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: import("../types").BaseMarkStyleProps;
|
|
4
|
+
props: import("../types.js").BaseMarkStyleProps;
|
|
5
5
|
events: {
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
package/dist/marks/GridX.svelte
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
|
+
import { get } from "underscore";
|
|
2
3
|
import BaseMark from "./BaseMark.svelte";
|
|
3
4
|
import resolveChannel from "../helpers/resolveChannel.js";
|
|
4
5
|
import getBaseStyles from "../helpers/getBaseStyles.js";
|
|
5
|
-
import { get } from "underscore";
|
|
6
6
|
const BaseMark_GridX = BaseMark;
|
|
7
7
|
const plot = getContext("svelteplot");
|
|
8
8
|
let {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { GridOptions } from '../types';
|
|
2
|
+
import type { GridOptions } from '../types.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: Partial<import("../types").MarkProps> & GridOptions & {
|
|
5
|
-
y1?: import("../types").ChannelAccessor | undefined;
|
|
6
|
-
y2?: import("../types").ChannelAccessor | undefined;
|
|
4
|
+
props: Partial<import("../types.js").MarkProps> & GridOptions & {
|
|
5
|
+
y1?: import("../types.js").ChannelAccessor | undefined;
|
|
6
|
+
y2?: import("../types.js").ChannelAccessor | undefined;
|
|
7
7
|
automatic?: boolean | undefined;
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
@@ -5,28 +5,26 @@ const plot = getContext("svelteplot");
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
{#if plot.color.manualActiveMarks.length > 0 && !(plot.options.color?.legend && plot.colorSymbolRedundant)}
|
|
8
|
-
<div class="symbol-legend">
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
8
|
+
<div class="symbol-legend">
|
|
9
|
+
{#each plot.symbolScale.domain() as value}
|
|
10
|
+
{@const symbolV = plot.symbolScale(value)}
|
|
11
|
+
{@const symbolType = maybeSymbol(symbolV)}
|
|
12
|
+
{@const color = plot.colorSymbolRedundant ? plot.colorScale(value) : 'currentColor'}
|
|
13
|
+
<div class="item">
|
|
14
|
+
<div class="swatch">
|
|
15
|
+
<svg width="15" height="15">
|
|
17
16
|
<path
|
|
18
17
|
transform="translate(7.5,7.5)"
|
|
19
18
|
fill={plot.hasFilledDotMarks ? color : 'none'}
|
|
20
19
|
stroke={plot.hasFilledDotMarks ? null : color}
|
|
21
20
|
d={d3Symbol(symbolType, 40)()}
|
|
22
21
|
/>
|
|
23
|
-
|
|
24
|
-
>
|
|
22
|
+
</svg>
|
|
23
|
+
</div>
|
|
24
|
+
<span class="item-label">{value}</span>
|
|
25
25
|
</div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{/each}
|
|
29
|
-
</div>
|
|
26
|
+
{/each}
|
|
27
|
+
</div>
|
|
30
28
|
{/if}
|
|
31
29
|
|
|
32
30
|
<style>
|
|
@@ -38,7 +36,9 @@ const plot = getContext("svelteplot");
|
|
|
38
36
|
.item {
|
|
39
37
|
margin: 0 1em 0.5ex 0;
|
|
40
38
|
}
|
|
41
|
-
path {
|
|
39
|
+
path {
|
|
40
|
+
stroke-width: 1.5;
|
|
41
|
+
}
|
|
42
42
|
.item,
|
|
43
43
|
.item-label,
|
|
44
44
|
.swatch {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { CHANNEL_TYPES } from './contants';
|
|
2
|
+
import type { CHANNEL_TYPES } from './contants.js';
|
|
3
3
|
import type { Plot } from './classes/Plot.svelte';
|
|
4
4
|
import type { MouseEventHandler } from 'svelte/elements';
|
|
5
5
|
export type Datasets = {
|