@fundar/data-chart-telling 0.0.6 → 0.0.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.
@@ -108,6 +108,7 @@
108
108
  progress={timeline.progress}
109
109
  values={timeline.values}
110
110
  orientation={timeline.orientation}
111
+ show={timeline.show}
111
112
  thickness={timeline.thickness ?? cfg.timeline.thickness}
112
113
  filterMode={timeline.filterMode}
113
114
  interpolate={typeof timeline.interpolate === 'object' ? timeline.interpolate : undefined}
@@ -22,6 +22,7 @@
22
22
  progress,
23
23
  values,
24
24
  orientation = 'vertical',
25
+ show = true,
25
26
  thickness = 60,
26
27
  filterMode = 'exact',
27
28
  interpolate,
@@ -34,6 +35,7 @@
34
35
  progress: number;
35
36
  values?: TimeValue[];
36
37
  orientation?: Orientation;
38
+ show?: boolean;
37
39
  thickness?: number;
38
40
  filterMode?: 'exact' | 'upTo';
39
41
  interpolate?: TimelineInterpolation<TRow>;
@@ -126,32 +128,37 @@
126
128
  });
127
129
 
128
130
  const isVertical = $derived(orientation === 'vertical');
129
- const gap = 12;
131
+ const gap = $derived(show ? 12 : 0);
132
+ const effectiveThickness = $derived(show ? thickness : 0);
130
133
  const innerWidth = $derived(
131
- Math.max(0, isVertical ? width - thickness - gap : width),
134
+ Math.max(0, isVertical ? width - effectiveThickness - gap : width),
132
135
  );
133
136
  const innerHeight = $derived(
134
- Math.max(0, isVertical ? height : height - thickness - gap),
137
+ Math.max(0, isVertical ? height : height - effectiveThickness - gap),
135
138
  );
136
139
  </script>
137
140
 
138
141
  {#if isVertical}
139
- <div class="dct-timeline dct-timeline--vertical" style:width="{width}px" style:height="{height}px">
142
+ <div class="dct-timeline dct-timeline--vertical" style:width="{width}px" style:height="{height}px" style:gap="{gap}px">
140
143
  <div class="dct-timeline__plot">
141
144
  {@render child({ selectedValue, data: filtered, width: innerWidth, height: innerHeight })}
142
145
  </div>
143
- <div class="dct-timeline__gutter" style:width="{thickness}px">
144
- <Timeline currentValue={selectedValue} values={steps} orientation="vertical" width={thickness} height={innerHeight} />
145
- </div>
146
+ {#if show}
147
+ <div class="dct-timeline__gutter" style:width="{thickness}px">
148
+ <Timeline currentValue={selectedValue} values={steps} orientation="vertical" width={thickness} height={innerHeight} />
149
+ </div>
150
+ {/if}
146
151
  </div>
147
152
  {:else}
148
- <div class="dct-timeline dct-timeline--horizontal" style:width="{width}px" style:height="{height}px">
153
+ <div class="dct-timeline dct-timeline--horizontal" style:width="{width}px" style:height="{height}px" style:gap="{gap}px">
149
154
  <div class="dct-timeline__plot">
150
155
  {@render child({ selectedValue, data: filtered, width: innerWidth, height: innerHeight })}
151
156
  </div>
152
- <div class="dct-timeline__gutter" style:height="{thickness}px">
153
- <Timeline currentValue={selectedValue} values={steps} orientation="horizontal" width={innerWidth} height={thickness} />
154
- </div>
157
+ {#if show}
158
+ <div class="dct-timeline__gutter" style:height="{thickness}px">
159
+ <Timeline currentValue={selectedValue} values={steps} orientation="horizontal" width={innerWidth} height={thickness} />
160
+ </div>
161
+ {/if}
155
162
  </div>
156
163
  {/if}
157
164
 
@@ -161,11 +168,9 @@
161
168
  }
162
169
  .dct-timeline--vertical {
163
170
  flex-direction: row;
164
- gap: 12px;
165
171
  }
166
172
  .dct-timeline--horizontal {
167
173
  flex-direction: column;
168
- gap: 12px;
169
174
  }
170
175
  .dct-timeline__plot {
171
176
  flex: 1 1 auto;
@@ -7,6 +7,7 @@ declare function $$render<TRow extends Record<string, unknown>>(): {
7
7
  progress: number;
8
8
  values?: TimeValue[];
9
9
  orientation?: Orientation;
10
+ show?: boolean;
10
11
  thickness?: number;
11
12
  filterMode?: "exact" | "upTo";
12
13
  interpolate?: TimelineInterpolation<TRow>;
@@ -52,6 +52,7 @@ export type TimelineConfig<TRow extends Record<string, unknown>> = {
52
52
  progress: number;
53
53
  values?: TimeValue[];
54
54
  orientation?: Orientation;
55
+ show?: boolean;
55
56
  thickness?: number;
56
57
  filterMode?: 'exact' | 'upTo';
57
58
  interpolate?: boolean | TimelineInterpolation<TRow>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fundar/data-chart-telling",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"