Skip to content

Core API

d3_bridge.core.Chart

Base class for all chart types.

Subclasses set chart_type and override _build_config() to add chart-specific options.

chart_type = 'base' class-attribute instance-attribute

__init__(data=None, **kw)

fields(*names)

Limit which fields are serialized from the data source.

extra_js(code)

Inject custom D3.js code (escape hatch).

set_theme(name)

set_margin(top=None, right=None, bottom=None, left=None)

to_config()

Full config dict ready for JSON serialization to JS runtime.

to_json(**kw)