Customization
Holochart's styling works as a cascade. Each layer overrides the one above it, so you can start with a theme and reach for more control only where you need it. This section will get one page per layer, with a runnable example each.
- Library defaults: the
dfltvalue of each attribute in the schema. - Theme or template:
holochart(the default look) unless you setlayout.template, such as'plotly_dark'or an object with layout and per-trace-type defaults. See Themes & templates. - Layout-level defaults:
layout.colorway,layout.font,layout.hoverlabel. - Trace attributes:
{ marker: { color: 'red', size: 8 } }. - Per-point arrays:
{ marker: { color: [...], size: [...] } }. See Per-point styling. - Style rules: serializable conditions such as
styleRules: [{ when: { y: { gt: 10 } }, set: { 'marker.color': 'gold' } }]. - Style functions:
{ marker: { color: (d, i) => (d.y > 10 ? 'gold' : 'gray') } }. Not serializable. - Material overrides:
{ material: { type: 'standard', metalness: 0.4 } }. See Materials & lighting. - Shader hooks: GLSL injected at named points in a trace's shaders.
- Render hooks and scene access:
chart.on('beforerender', ...)andchart.three.scene. See Adding your own three.js objects. - Custom traces and components:
register(myTraceModule). See Writing a custom trace.
Holochart also adds 3D-native options: any 2D trace can take depth and material (with castshadow), and any 2D subplot can be shown in perspective with layout.view3d. See Extrusion & 2.5D (bars today).
See also Custom markers, patterns & textures.