@n1kname/components 0.10.0 → 0.11.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/package.json +2 -2
- package/src/RankedBars.astro +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n1kname/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"./daystrips.js": "./src/daystrips.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@n1kname/charts": "0.
|
|
17
|
+
"@n1kname/charts": "0.6.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"astro": "^7.4.4"
|
package/src/RankedBars.astro
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Ranked bars in plain HTML and CSS, so the labels are real text. Safari lays out
|
|
4
4
|
* SVG text with the fallback font's widths and then paints the web font, so
|
|
5
|
-
* right-aligned SVG labels come out uneven and run into the bars.
|
|
6
|
-
*
|
|
5
|
+
* right-aligned SVG labels come out uneven and run into the bars. The data stays in this
|
|
6
|
+
* page's HTML. The only script is the arrival: the bars grow in once as the chart comes into
|
|
7
|
+
* view, and without it they are simply there. Rows keep the order given.
|
|
7
8
|
* `alt` speaks for the chart, and needs every value.
|
|
8
9
|
*/
|
|
9
10
|
import Figure from './Figure.astro';
|
|
@@ -45,6 +46,11 @@ const max = Math.max(...data.map((d) => d.value));
|
|
|
45
46
|
</div>
|
|
46
47
|
</Figure>
|
|
47
48
|
|
|
49
|
+
<script>
|
|
50
|
+
import { enterAll } from '@n1kname/charts/enter';
|
|
51
|
+
enterAll('.ranked-bars');
|
|
52
|
+
</script>
|
|
53
|
+
|
|
48
54
|
<style>
|
|
49
55
|
.ranked-bars {
|
|
50
56
|
min-width: 0;
|