layerchart 0.51.1 → 0.51.2

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.
@@ -55,7 +55,12 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
55
55
  yBaseline={0}
56
56
  yNice
57
57
  {radial}
58
- padding={radial || axis === false ? undefined : { left: 16, bottom: 16 }}
58
+ padding={radial || axis === false
59
+ ? undefined
60
+ : {
61
+ left: axis === true || axis === 'y' ? 16 : 0,
62
+ bottom: axis === true || axis === 'x' ? 16 : 0,
63
+ }}
59
64
  tooltip={{ mode: 'bisect-x' }}
60
65
  {...$$restProps}
61
66
  let:x
@@ -72,22 +77,27 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
72
77
  <Svg center={radial}>
73
78
  <slot name="axis" {...slotProps}>
74
79
  {#if axis}
75
- <Axis
76
- placement={radial ? 'radius' : 'left'}
77
- grid
78
- rule
79
- format={(value) => format(value, undefined, { variant: 'short' })}
80
- {...typeof axis === 'object' ? axis : null}
81
- {...props.yAxis}
82
- />
83
- <Axis
84
- placement={radial ? 'angle' : 'bottom'}
85
- grid={radial}
86
- rule
87
- format={(value) => format(value, undefined, { variant: 'short' })}
88
- {...typeof axis === 'object' ? axis : null}
89
- {...props.xAxis}
90
- />
80
+ {#if axis !== 'x'}
81
+ <Axis
82
+ placement={radial ? 'radius' : 'left'}
83
+ grid
84
+ rule
85
+ format={(value) => format(value, undefined, { variant: 'short' })}
86
+ {...typeof axis === 'object' ? axis : null}
87
+ {...props.yAxis}
88
+ />
89
+ {/if}
90
+
91
+ {#if axis !== 'y'}
92
+ <Axis
93
+ placement={radial ? 'angle' : 'bottom'}
94
+ grid={radial}
95
+ rule
96
+ format={(value) => format(value, undefined, { variant: 'short' })}
97
+ {...typeof axis === 'object' ? axis : null}
98
+ {...props.xAxis}
99
+ />
100
+ {/if}
91
101
  {/if}
92
102
  </slot>
93
103
 
@@ -194,7 +194,7 @@ declare class __sveltets_Render<TData> {
194
194
  offset?: number | undefined;
195
195
  format?: import("@layerstack/utils").FormatType | undefined;
196
196
  };
197
- axis?: boolean | {
197
+ axis?: boolean | "x" | "y" | {
198
198
  placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
199
199
  label?: string;
200
200
  labelPlacement?: "start" | "middle" | "end";
@@ -96,7 +96,12 @@ $: if (stackSeries) {
96
96
  {y1Scale}
97
97
  {y1Domain}
98
98
  {y1Range}
99
- padding={axis === false ? undefined : { left: 16, bottom: 16 }}
99
+ padding={axis === false
100
+ ? undefined
101
+ : {
102
+ left: axis === true || axis === 'y' ? 16 : 0,
103
+ bottom: axis === true || axis === 'x' ? 16 : 0,
104
+ }}
100
105
  tooltip={{ mode: 'band' }}
101
106
  {...$$restProps}
102
107
  let:x
@@ -113,22 +118,27 @@ $: if (stackSeries) {
113
118
  <Svg>
114
119
  <slot name="axis" {...slotProps}>
115
120
  {#if axis}
116
- <Axis
117
- placement="left"
118
- grid={isVertical}
119
- rule
120
- format={(value) => format(value, undefined, { variant: 'short' })}
121
- {...typeof axis === 'object' ? axis : null}
122
- {...props.yAxis}
123
- />
124
- <Axis
125
- placement="bottom"
126
- grid={!isVertical}
127
- rule
128
- format={(value) => format(value, undefined, { variant: 'short' })}
129
- {...typeof axis === 'object' ? axis : null}
130
- {...props.xAxis}
131
- />
121
+ {#if axis !== 'x'}
122
+ <Axis
123
+ placement="left"
124
+ grid={isVertical}
125
+ rule
126
+ format={(value) => format(value, undefined, { variant: 'short' })}
127
+ {...typeof axis === 'object' ? axis : null}
128
+ {...props.yAxis}
129
+ />
130
+ {/if}
131
+
132
+ {#if axis !== 'y'}
133
+ <Axis
134
+ placement="bottom"
135
+ grid={!isVertical}
136
+ rule
137
+ format={(value) => format(value, undefined, { variant: 'short' })}
138
+ {...typeof axis === 'object' ? axis : null}
139
+ {...props.xAxis}
140
+ />
141
+ {/if}
132
142
  {/if}
133
143
  </slot>
134
144
 
@@ -193,7 +193,7 @@ declare class __sveltets_Render<TData> {
193
193
  offset?: number | undefined;
194
194
  format?: import("@layerstack/utils").FormatType | undefined;
195
195
  };
196
- axis?: boolean | {
196
+ axis?: boolean | "x" | "y" | {
197
197
  placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
198
198
  label?: string;
199
199
  labelPlacement?: "start" | "middle" | "end";
@@ -36,7 +36,12 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
36
36
  yBaseline={0}
37
37
  yNice
38
38
  {radial}
39
- padding={radial || axis === false ? undefined : { left: 16, bottom: 16 }}
39
+ padding={radial || axis === false
40
+ ? undefined
41
+ : {
42
+ left: axis === true || axis === 'y' ? 16 : 0,
43
+ bottom: axis === true || axis === 'x' ? 16 : 0,
44
+ }}
40
45
  tooltip={{ mode: 'bisect-x' }}
41
46
  {...$$restProps}
42
47
  let:x
@@ -53,22 +58,27 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
53
58
  <Svg center={radial}>
54
59
  <slot name="axis" {...slotProps}>
55
60
  {#if axis}
56
- <Axis
57
- placement={radial ? 'radius' : 'left'}
58
- grid
59
- rule
60
- format={(value) => format(value, undefined, { variant: 'short' })}
61
- {...typeof axis === 'object' ? axis : null}
62
- {...props.yAxis}
63
- />
64
- <Axis
65
- placement={radial ? 'angle' : 'bottom'}
66
- grid={radial}
67
- rule
68
- format={(value) => format(value, undefined, { variant: 'short' })}
69
- {...typeof axis === 'object' ? axis : null}
70
- {...props.xAxis}
71
- />
61
+ {#if axis !== 'x'}
62
+ <Axis
63
+ placement={radial ? 'radius' : 'left'}
64
+ grid
65
+ rule
66
+ format={(value) => format(value, undefined, { variant: 'short' })}
67
+ {...typeof axis === 'object' ? axis : null}
68
+ {...props.yAxis}
69
+ />
70
+ {/if}
71
+
72
+ {#if axis !== 'y'}
73
+ <Axis
74
+ placement={radial ? 'angle' : 'bottom'}
75
+ grid={radial}
76
+ rule
77
+ format={(value) => format(value, undefined, { variant: 'short' })}
78
+ {...typeof axis === 'object' ? axis : null}
79
+ {...props.xAxis}
80
+ />
81
+ {/if}
72
82
  {/if}
73
83
  </slot>
74
84
 
@@ -193,7 +193,7 @@ declare class __sveltets_Render<TData> {
193
193
  offset?: number | undefined;
194
194
  format?: import("@layerstack/utils").FormatType | undefined;
195
195
  };
196
- axis?: boolean | {
196
+ axis?: boolean | "x" | "y" | {
197
197
  placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
198
198
  label?: string;
199
199
  labelPlacement?: "start" | "middle" | "end";
@@ -29,7 +29,12 @@ let chartData = series
29
29
  {xScale}
30
30
  {y}
31
31
  yNice
32
- padding={axis === false ? undefined : { left: 16, bottom: 16 }}
32
+ padding={axis === false
33
+ ? undefined
34
+ : {
35
+ left: axis === true || axis === 'y' ? 16 : 0,
36
+ bottom: axis === true || axis === 'x' ? 16 : 0,
37
+ }}
33
38
  tooltip={{ mode: 'voronoi' }}
34
39
  {...$$restProps}
35
40
  let:x
@@ -52,22 +57,27 @@ let chartData = series
52
57
  <Svg>
53
58
  <slot name="axis" {...slotProps}>
54
59
  {#if axis}
55
- <Axis
56
- placement="left"
57
- grid
58
- rule
59
- format={(value) => format(value, undefined, { variant: 'short' })}
60
- {...typeof axis === 'object' ? axis : null}
61
- {...props.yAxis}
62
- />
63
- <Axis
64
- placement="bottom"
65
- grid
66
- rule
67
- format={(value) => format(value, undefined, { variant: 'short' })}
68
- {...typeof axis === 'object' ? axis : null}
69
- {...props.xAxis}
70
- />
60
+ {#if axis !== 'x'}
61
+ <Axis
62
+ placement="left"
63
+ grid
64
+ rule
65
+ format={(value) => format(value, undefined, { variant: 'short' })}
66
+ {...typeof axis === 'object' ? axis : null}
67
+ {...props.yAxis}
68
+ />
69
+ {/if}
70
+
71
+ {#if axis !== 'y'}
72
+ <Axis
73
+ placement="bottom"
74
+ grid
75
+ rule
76
+ format={(value) => format(value, undefined, { variant: 'short' })}
77
+ {...typeof axis === 'object' ? axis : null}
78
+ {...props.xAxis}
79
+ />
80
+ {/if}
71
81
  {/if}
72
82
  </slot>
73
83
 
@@ -190,7 +190,7 @@ declare class __sveltets_Render<TData> {
190
190
  offset?: number | undefined;
191
191
  format?: import("@layerstack/utils").FormatType | undefined;
192
192
  };
193
- axis?: boolean | {
193
+ axis?: boolean | "x" | "y" | {
194
194
  placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
195
195
  label?: string;
196
196
  labelPlacement?: "start" | "middle" | "end";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Sean Lynch <techniq35@gmail.com>",
5
5
  "license": "MIT",
6
6
  "repository": "techniq/layerchart",
7
- "version": "0.51.1",
7
+ "version": "0.51.2",
8
8
  "devDependencies": {
9
9
  "@changesets/cli": "^2.27.7",
10
10
  "@mdi/js": "^7.4.47",