Ray1ee01's picture
Add runnable ChartPipeline Space
216c0a4 verified
|
Raw
History Blame Contribute Delete
1.06 kB

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:

python scripts/build_chart_utils_bundle.py