Skip to main content

dash-echartsx

A high-performance, developer-friendly Python wrapper for Apache ECharts 5.6+ and 6 in Plotly Dash.

Static Gallery

The local Dash gallery and its live Python option viewer are in example_app. Run it from that directory with python app.py to use interactive charts. The linked Hugging Face Space is a free static showcase of screenshots and GIFs; it does not run a Dash server. Its HTML source and deployment instructions are in example_app/static_space.

Browse examples by chart type, search for a specific pattern, then open a chart to explore it alongside its Python configuration.

DashEChartsX examples gallery showing searchable chart cards grouped by type

The animated bar-race example updates its rankings in place:

Animated bar-race chart

Drag the financial chart's slider to zoom into a date range:

Candlestick chart zoomed with its data slider

Click a map boundary to select a region and read its index:

Map interaction showing selected region indices

Reusable release banners, Python snippet cards, comparison graphics, and announcement copy are collected in the promotion kit.

Python support

The package requires Python 3.10 or newer. CI tests Python 3.10 through 3.14 on Ubuntu, macOS, and Windows, and builds wheel and source distributions for each matrix combination. Pull request runs upload those distributions as GitHub Actions artifacts for inspection before release.

Python typing and IDE support

DashEChartsX ships with a generated DashEChartsX.pyi stub. Its constructor provides typed, discoverable component props in editors such as VS Code and PyCharm, including the renderer literals, theme, maps, event payloads, and streaming data. Prop descriptions and defaults are included in the generated component documentation. The stub is regenerated from component metadata by npm run build.

JavaScript option functions

ECharts options can include formatter and callback functions through the js_function helper. The helper serializes source into an explicit marker that DashEChartsX resolves in the browser immediately before calling setOption:

from dash_echartsx.utils import js_function

option = {
    "tooltip": {
        "formatter": js_function(
            "function(params) { return params.name + ': ' + params.value; }"
        )
    },
    "xAxis": {
        "axisLabel": {
            "formatter": js_function("function(value) { return value + ' kg'; }")
        }
    },
    "series": [
        {
            "type": "custom",
            "renderItem": js_function(
                "function(params, api) { return { type: 'rect', shape: "
                "{ x: api.coord([api.value(0), 0])[0], y: api.coord([0, "
                "api.value(1)])[1], width: 10, height: 10 }, style: "
                "api.style() }; }"
            ),
        }
    ],
}

Only objects containing the __js_eval__ marker are compiled; ordinary option strings are not evaluated. Marked source is executable JavaScript, not a sandboxed expression: use it only for code authored and reviewed by the application developer. Never build it from user input or untrusted data. Because compilation uses the JavaScript Function constructor, deployments with a Content Security Policy that disallows unsafe-eval cannot use marked functions. Compilation errors and invalid marker objects are reported rather than silently ignored.

Custom maps and 3D charts

Register custom GeoJSON maps with the maps property. Definitions are registered with ECharts before the option is applied:

from dash_echartsx import DashEChartsX

DashEChartsX(
    maps=[{"name": "districts", "geoJSON": geojson}],
    option={
        "series": [
            {"type": "map", "map": "districts", "data": region_values}
        ]
    },
)

SVG map data uses ECharts' { "svg": ... } map definition in the same property:

from dash_echartsx import DashEChartsX

DashEChartsX(
    maps=[{"name": "floorplan", "geoJSON": {"svg": svg_markup}}],
    option={"geo": {"map": "floorplan"}, "series": []},
)

ECharts-GL charts use a separate bundle and load only when enable_gl=True:

from dash_echartsx import DashEChartsX

DashEChartsX(
    enable_gl=True,
    option={
        "grid3D": {},
        "xAxis3D": {},
        "yAxis3D": {},
        "zAxis3D": {},
        "series": [{"type": "scatter3D", "data": [[0, 0, 0], [1, 1, 1]]}],
    },
)

The GL bundle is served by Dash alongside the core bundle but is not requested unless enabled. Set gl_bundle_url if hosting that bundle separately. The project supports ECharts 5.6 and 6.x; CI builds against both.

Documentation

The documentation site includes the Python and TypeScript API references, a live option playground, and runnable examples. See the example gallery and migration guide for more. Build the docs locally with uv sync --group dev --group docs, npm ci, and npm run docs:build.

Streaming and large datasets

For regular option updates, DashEChartsX calls ECharts setOption with merge enabled by default (notMerge=False). This applies partial option updates without replacing the whole chart configuration. Set lazyUpdate=True to defer option processing, or set notMerge=True when an update should replace the existing option.

For supported series types, send new data in batches with append_data instead of resending the entire option and dataset on every callback:

from dash import Input, Output, callback
from dash_echartsx import DashEChartsX

chart = DashEChartsX(
    id="telemetry",
    notMerge=False,
    lazyUpdate=True,
    option={
        "xAxis": {"type": "time"},
        "yAxis": {"type": "value"},
        "series": [
            {
                "type": "scatter",
                "symbolSize": 4,
                "progressive": 5000,
                "progressiveThreshold": 10000,
                "data": [],
            }
        ],
    },
)


@callback(
    Output("telemetry", "append_data"),
    Input("telemetry-batch", "data"),
)
def append_telemetry(batch):
    return {"seriesIndex": 0, "data": batch}

append_data expects an object with a seriesIndex and a data batch matching that series' data format. ECharts only supports appendData for some series types; it cannot be used with dataset. Progressive rendering is configured on each series through the standard ECharts progressive and progressiveThreshold options. Choose batch sizes and progressive settings for the target chart and browser, and bound retained data when the application needs a fixed memory footprint. appendData does not recalculate coordinate-system axis extents, so configure fixed axis bounds for continuously appended data or update the chart option separately when bounds need to move.

Event callbacks

Chart interactions are exposed as Dash properties: click_data, dblclick_data, hover_data, selected_data, legend_status, and zoom_data. Event payloads are JSON-safe dictionaries; data events include seriesIndex, dataIndex, name, and value when ECharts provides them.

Use any event property as a callback input:

from dash import Input, Output


@app.callback(Output("interaction", "children"), Input("chart", "click_data"))
def show_click(data):
	return str(data)

To trigger an ECharts action from Python, return a payload through dispatch_action. Supported action types are highlight, downplay, showTip, hideTip, selectDataRange, legendSelect, and dataZoom:

@app.callback(
	Output("chart", "dispatch_action"),
	Input("show-point", "n_clicks"),
	prevent_initial_call=True,
)
def show_point(_):
	return {"type": "showTip", "seriesIndex": 0, "dataIndex": 2}

Development

Use uv to sync the Python project and npm to install JavaScript dependencies, then build the browser bundles and generated Python component wrapper:

uv sync --group dev
npm ci
npm run build

The build writes ES module and UMD bundles to dash_echartsx/ and generates the Dash Python component wrapper there. Check the TypeScript sources with npm run typecheck and run the Python tests with uv run pytest.

Code Quality

Run the JavaScript/TypeScript lint and formatting checks with npm run lint. Run Python linting and formatting checks with uv run ruff check . and uv run black --check dash_echartsx tests. Pre-commit hooks run lint-staged automatically after npm install configures Husky.

Releasing

Update the version in pyproject.toml, package.json, and dash_echartsx/__init__.py, and record the release in CHANGELOG.md. Publishing a GitHub release with a vMAJOR.MINOR.PATCH tag runs the release workflow, which validates the versions, runs quality checks, builds and verifies the distributions, attaches them to the GitHub release, and publishes to PyPI through OIDC.

Before the first release, configure a PyPI Trusted Publisher for owner rakrsh, repository dash-echartsx, workflow release.yml, and GitHub environment pypi. No PyPI API token secret is required.

Metadata

Release files for dash-echartsx 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dash-echartsx 0.2.0
File Size Uploaded Provenance Actions
dash_echartsx-0.2.0.tar.gz 3.8 MB With provenance Details for dash_echartsx-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dash-echartsx 0.2.0
File Interpreter ABI Platform Actions
dash_echartsx-0.2.0-py3-none-any.whl Python 3 none any Details for dash_echartsx-0.2.0-py3-none-any.whl

Total release size: 5.2 MB

Release files / dash_echartsx-0.2.0.tar.gz

Download URL dash_echartsx-0.2.0.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2f77bdf01fcb96d644dc5e6877704bcdecbd8d11acb3b0acfe648f47eec1c07c
BLAKE2b-256 checksum
How to use checksums
a4cf60f5ff7fbb57ea07d1fb80b21e4229cfc01cd98ca5d755ac53d08e0559fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / dash_echartsx-0.2.0-py3-none-any.whl

Download URL dash_echartsx-0.2.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
59148f843c84b5aead0d992e662f36ab4676e9db1cd744e3ccd69dff727adc82
BLAKE2b-256 checksum
How to use checksums
83f8bd0d5d497997008a299e83cfaf0ce6ec3c4ae3c631ab0dd6615899d66472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for dash-echartsx 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dash_echartsx-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page