@humanforest/charts 0.3.4 → 0.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanforest/charts",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -24,7 +24,7 @@
24
24
  "vue": "^3.5.22"
25
25
  },
26
26
  "dependencies": {
27
- "@humanforest/tokens": "^0.3.4"
27
+ "@humanforest/tokens": "^0.3.5"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
@@ -138,9 +138,6 @@ const barFor = (v: number | null) => {
138
138
  // A reading of zero keeps a hairline. Zero is a real measurement and a gap is the absence of
139
139
  // one; collapsing the bar to nothing would render the two identically.
140
140
  height: `max(${(to - from) * 100}%, 1px)`,
141
- // The cap goes on the free end, so a bar below the baseline rounds downward rather than into
142
- // the axis it grows from.
143
- negative: v < 0,
144
141
  };
145
142
  };
146
143
 
@@ -163,7 +160,8 @@ const endpointTop = computed(() => {
163
160
  The 2px gap is fixed, so the bucket count sets how thin the bars get: n buckets across w
164
161
  pixels leaves (w - 2(n - 1)) / n each. A tile 280px wide holds 12 buckets at 21px and 60 at
165
162
  2.7px — still bars; past roughly 60 the gap outweighs the bar and the row reads as a
166
- texture, where the measure belongs to a line instead. -->
163
+ texture, where the measure belongs to a line instead. Each bar is rounded at both ends:
164
+ no baseline is drawn for a square end to sit on. -->
167
165
  <div v-if="mark === 'bar'" class="flex w-full items-end gap-0.5" :class="fill ? 'absolute inset-0' : 'h-full'" aria-hidden="true">
168
166
  <span
169
167
  v-for="(v, i) in data"
@@ -172,8 +170,7 @@ const endpointTop = computed(() => {
172
170
  >
173
171
  <span
174
172
  v-if="barFor(v)"
175
- class="absolute inset-x-0 bg-current"
176
- :class="barFor(v)!.negative ? 'rounded-b-[3px]' : 'rounded-t-[3px]'"
173
+ class="absolute inset-x-0 rounded-[3px] bg-current"
177
174
  :style="{ bottom: barFor(v)!.bottom, height: barFor(v)!.height }"
178
175
  />
179
176
  </span>