chart-factory 0.1.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.
- package/LICENSE +21 -0
- package/README.md +162 -0
- package/dist/chart-factory-table.js +1400 -0
- package/dist/chart-factory.css +2368 -0
- package/dist/chart-factory.js +11398 -0
- package/dist/chart-factory.min.js +7 -0
- package/docs/API.md +1815 -0
- package/docs/chart-guide.md +872 -0
- package/docs/color-guide.md +134 -0
- package/docs/conformance-matrix.md +864 -0
- package/docs/theming.md +107 -0
- package/index.d.ts +10453 -0
- package/package.json +83 -0
- package/src/core/base.css +508 -0
- package/src/core/builder-metadata.generated.mjs +406 -0
- package/src/core/d3-base.js +249 -0
- package/src/core/d3-chart-factory.js +18547 -0
- package/src/core/d3-data.js +0 -0
- package/src/core/d3-suggest.js +565 -0
- package/src/core/example-nav.css +62 -0
- package/src/core/example-nav.js +249 -0
- package/src/core/palettes.js +310 -0
- package/src/core/theme-toggle.js +126 -0
- package/src/core/tokens.css +792 -0
- package/src/table/d3-table.js +1570 -0
- package/src/table/table.css +899 -0
- package/src/table/tokens.css +157 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D3Table - Table-Specific Design Tokens
|
|
3
|
+
*
|
|
4
|
+
* These tokens extend the core tokens for table-specific styling.
|
|
5
|
+
* Import after core tokens:
|
|
6
|
+
*
|
|
7
|
+
* @import 'chart-factory/core/tokens.css';
|
|
8
|
+
* @import 'chart-factory/table/tokens.css';
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
:root {
|
|
12
|
+
/* ===========================
|
|
13
|
+
TABLE TYPOGRAPHY
|
|
14
|
+
=========================== */
|
|
15
|
+
--table-font-size: var(--font-size-lg);
|
|
16
|
+
--table-header-font-size: var(--font-size-sm);
|
|
17
|
+
|
|
18
|
+
/* Cell type font sizes (generic names) */
|
|
19
|
+
--table-primary-font-size: var(--font-size-xl); /* Bold key column */
|
|
20
|
+
--table-secondary-font-size: var(--font-size-md); /* Muted index column */
|
|
21
|
+
|
|
22
|
+
/* Key-column font family — column-width measurement honors it, so themes
|
|
23
|
+
can retarget the primary cells' face without breaking layout */
|
|
24
|
+
--table-primary-font: var(--font-family);
|
|
25
|
+
|
|
26
|
+
/* Legacy aliases (for backwards compatibility) */
|
|
27
|
+
--table-team-font-size: var(--table-primary-font-size);
|
|
28
|
+
--table-rank-font-size: var(--table-secondary-font-size);
|
|
29
|
+
|
|
30
|
+
/* ===========================
|
|
31
|
+
TABLE LAYOUT
|
|
32
|
+
=========================== */
|
|
33
|
+
--table-cell-height: var(--space-7);
|
|
34
|
+
--table-cell-padding-y: var(--space-1);
|
|
35
|
+
--table-cell-padding-x: var(--space-5);
|
|
36
|
+
--table-cell-padding-near: var(--space-2); /* Small padding on aligned edge */
|
|
37
|
+
--table-header-padding-y: var(--space-2);
|
|
38
|
+
--table-header-padding-bottom: var(--space-1);
|
|
39
|
+
|
|
40
|
+
--table-header-border: 2px solid var(--color-border-header);
|
|
41
|
+
--table-row-border: 1px solid var(--color-border-row);
|
|
42
|
+
|
|
43
|
+
/* ===========================
|
|
44
|
+
TABLE BAR CHARTS
|
|
45
|
+
=========================== */
|
|
46
|
+
--bar-margin-y: 3px;
|
|
47
|
+
--table-bar-border-radius: 2px; /* renamed from --bar-border-radius, which collided with core tokens */
|
|
48
|
+
--bar-opacity: 0.85;
|
|
49
|
+
--bar-max-width-percent: 70; /* Max bar width as percentage of cell */
|
|
50
|
+
--bar-max-width-percent-highlighted: 65; /* Slightly smaller when highlighted */
|
|
51
|
+
--bar-label-max-position: 75; /* Max label position as percentage */
|
|
52
|
+
--bar-label-margin: 2%;
|
|
53
|
+
--bar-text-padding: var(--space-1);
|
|
54
|
+
--bar-column-min-width: 130px;
|
|
55
|
+
--bar-column-max-width: 250px;
|
|
56
|
+
|
|
57
|
+
/* Wrapped text cells (column config wrap: true) */
|
|
58
|
+
--table-wrap-line-height: 1.35;
|
|
59
|
+
--table-wrap-min-width: 110px; /* fill-layout floor for wrap columns */
|
|
60
|
+
|
|
61
|
+
/* Sorted-column highlight (neutral wash on the user-sorted column) */
|
|
62
|
+
--table-sorted-column-bg: rgba(0, 0, 0, 0.03);
|
|
63
|
+
--table-sorted-column-bg-hover: rgba(0, 0, 0, 0.05);
|
|
64
|
+
|
|
65
|
+
/* ===========================
|
|
66
|
+
TABLE STICKY / CAP / TOTALS
|
|
67
|
+
=========================== */
|
|
68
|
+
--table-sticky-bg: #ffffff; /* opaque backing for stuck header/column cells */
|
|
69
|
+
--table-sticky-edge-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.18);
|
|
70
|
+
--table-total-border: 2px solid var(--color-black);
|
|
71
|
+
|
|
72
|
+
/* Column group header rule (inset from cell edges to gap adjacent groups) */
|
|
73
|
+
--table-group-rule-color: var(--color-border-row);
|
|
74
|
+
--table-group-rule-width: 1px;
|
|
75
|
+
--table-group-rule-inset: 10px;
|
|
76
|
+
|
|
77
|
+
/* ===========================
|
|
78
|
+
TABLE EXPANDABLE SUB-ROWS
|
|
79
|
+
=========================== */
|
|
80
|
+
--table-toggle-width: 14px;
|
|
81
|
+
--table-subrow-indent: 22px;
|
|
82
|
+
|
|
83
|
+
/* ===========================
|
|
84
|
+
TABLE IMAGES (logos / flags / headshots)
|
|
85
|
+
=========================== */
|
|
86
|
+
--table-image-size: 22px;
|
|
87
|
+
--table-image-gap: var(--space-2);
|
|
88
|
+
--table-image-radius: 4px;
|
|
89
|
+
|
|
90
|
+
/* ===========================
|
|
91
|
+
TABLE HEATMAP
|
|
92
|
+
=========================== */
|
|
93
|
+
--heatmap-box-padding: var(--space-2);
|
|
94
|
+
--heatmap-box-height: 25px;
|
|
95
|
+
--heatmap-box-min-width: 40px;
|
|
96
|
+
--heatmap-box-border-radius: var(--table-bar-border-radius);
|
|
97
|
+
|
|
98
|
+
/* ===========================
|
|
99
|
+
TABLE COLUMN WIDTHS
|
|
100
|
+
=========================== */
|
|
101
|
+
--col-primary-max-width: 250px;
|
|
102
|
+
--col-secondary-max-width: 40px;
|
|
103
|
+
--col-default-max-width: 150px;
|
|
104
|
+
--col-padding-total: 28px;
|
|
105
|
+
--col-padding-secondary: 10px;
|
|
106
|
+
|
|
107
|
+
/* Secondary/rank column constraints */
|
|
108
|
+
--col-secondary-min: 18px;
|
|
109
|
+
|
|
110
|
+
/* Legacy aliases */
|
|
111
|
+
--col-rank-min: var(--col-secondary-min);
|
|
112
|
+
--col-rank-max: var(--col-secondary-max-width);
|
|
113
|
+
|
|
114
|
+
/* ===========================
|
|
115
|
+
TABLE SORTING
|
|
116
|
+
=========================== */
|
|
117
|
+
--sort-indicator-size: 10px;
|
|
118
|
+
--sort-indicator-color: var(--color-text-muted);
|
|
119
|
+
--sort-indicator-active-color: var(--color-black);
|
|
120
|
+
--sort-hover-bg: var(--color-bg-hover);
|
|
121
|
+
--sort-transition-duration: var(--animation-duration-fast);
|
|
122
|
+
/* CSS-drawn chevron on the active sort column (idle columns show nothing) */
|
|
123
|
+
--sort-chevron-size: 5px;
|
|
124
|
+
--sort-chevron-stroke: 1.5px;
|
|
125
|
+
--sort-indicator-opacity: 0.5;
|
|
126
|
+
|
|
127
|
+
/* ===========================
|
|
128
|
+
FILL LAYOUT (readable floor)
|
|
129
|
+
Per-column minimums summed into the table's min-width;
|
|
130
|
+
below that floor the wrapper scrolls horizontally.
|
|
131
|
+
=========================== */
|
|
132
|
+
--table-min-col-width: 48px;
|
|
133
|
+
--table-min-col-width-primary: 110px;
|
|
134
|
+
--table-min-col-width-secondary: 28px;
|
|
135
|
+
|
|
136
|
+
/* ===========================
|
|
137
|
+
TABLE RESPONSIVE
|
|
138
|
+
=========================== */
|
|
139
|
+
--table-font-size-mobile: var(--font-size-md);
|
|
140
|
+
--table-header-font-size-mobile: var(--font-size-xs);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* ===========================
|
|
144
|
+
DARK THEME
|
|
145
|
+
===========================
|
|
146
|
+
Companion to the core tokens' [data-theme="dark"] block — most table
|
|
147
|
+
tokens reference core tokens and flip automatically; only the literal
|
|
148
|
+
light-mode values are overridden here. */
|
|
149
|
+
:root[data-theme="dark"] {
|
|
150
|
+
/* White-based wash — the light theme's black-based rgba would vanish */
|
|
151
|
+
--table-sorted-column-bg: rgba(255, 255, 255, 0.045);
|
|
152
|
+
--table-sorted-column-bg-hover: rgba(255, 255, 255, 0.07);
|
|
153
|
+
|
|
154
|
+
/* Opaque backing for stuck header/column cells */
|
|
155
|
+
--table-sticky-bg: var(--color-bg-container);
|
|
156
|
+
--table-sticky-edge-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.7);
|
|
157
|
+
}
|