Spaces:
Sleeping
Sleeping
File size: 1,060 Bytes
216c0a4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # D3 Chart Utils
This directory is the source of the D3 template standardization library.
File order matters:
1. `core.js`
2. `schema.js`
3. `format.js`
4. `color.js`
5. `text.js`
6. `legend.js`
7. `index.js`
8. `compat.js`
`load_charts.py` loads these files in the order above for D3 templates.
`../utils.js` is the compatibility bundle for older single-file consumers.
Common standardization entry points:
- `chartUtils.schema.columns(jsonData)` for raw column arrays.
- `chartUtils.schema.channel/jsonData`, `channels(...)`, `columnField(...)`, and `field(...)` for field lookup.
- `chartUtils.format.*` for number, unit, percent, and date formatting.
- `chartUtils.color.resolver(jsonData)` for text, background, field, and palette colors.
- `chartUtils.text.measure(...)`, `nodeWidth(...)`, `contextWidth(...)`, and `estimate(...)` for text sizing.
- `chartUtils.legend.layout(...)` and `draw(...)` for reusable legend layout and rendering.
After editing files here, rebuild the bundle with:
```bash
python scripts/build_chart_utils_bundle.py
```
|