{"id":51326897,"url":"https://github.com/darylalim/streamlit-highcharts","last_synced_at":"2026-07-01T19:02:49.260Z","repository":{"id":317410132,"uuid":"1067281702","full_name":"darylalim/streamlit-highcharts","owner":"darylalim","description":"Streamlit app for building data visualizations with the Highcharts for Python Toolkit.","archived":false,"fork":false,"pushed_at":"2026-06-18T05:23:30.000Z","size":309,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T07:23:17.755Z","etag":null,"topics":["data-visualization","highcharts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darylalim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-30T16:24:07.000Z","updated_at":"2026-06-18T05:24:32.000Z","dependencies_parsed_at":"2025-09-30T18:30:56.390Z","dependency_job_id":null,"html_url":"https://github.com/darylalim/streamlit-highcharts","commit_stats":null,"previous_names":["darylalim/highcharts-for-python-demos","darylalim/highcharts-python-pipeline","darylalim/streamlit-highcharts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darylalim/streamlit-highcharts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darylalim%2Fstreamlit-highcharts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darylalim%2Fstreamlit-highcharts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darylalim%2Fstreamlit-highcharts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darylalim%2Fstreamlit-highcharts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darylalim","download_url":"https://codeload.github.com/darylalim/streamlit-highcharts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darylalim%2Fstreamlit-highcharts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35019037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","highcharts"],"created_at":"2026-07-01T19:02:48.602Z","updated_at":"2026-07-01T19:02:49.243Z","avatar_url":"https://github.com/darylalim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# streamlit-highcharts\n\nAn interactive [Streamlit](https://streamlit.io) app that builds visualizations\nfrom pandas DataFrames with the\n[Highcharts for Python](https://github.com/highcharts-for-python) toolkit —\n**every chart is produced by `highcharts-core`**, with no native Streamlit charts.\n\n## Setup\n\nThis project uses [uv](https://docs.astral.sh/uv/) for dependency management.\n\n```bash\nuv sync\n```\n\n## Run\n\n```bash\nuv run streamlit run streamlit_app.py\n```\n\nThen open \u003chttp://localhost:8501\u003e. Pick a sample dataset (or upload a CSV),\nchoose a chart type and columns, and switch between three render modes:\ninteractive (CDN iframe), interactive with click events, or a static PNG.\n\n## What it does\n\n- Turns a `pandas.DataFrame` into a Highcharts options `dict`, then a `Chart`\n  via `Chart.from_options(...)`. Series share a brand palette (`DEFAULT_COLORS`)\n  that matches the Streamlit theme in `.streamlit/config.toml`.\n- Three render modes, chosen from the sidebar **Render** selector:\n  - **Interactive** (default): serialize the chart with its own\n    `get_script_tags()` (Highcharts CDN `\u003cscript\u003e` tags) + `to_js_literal()`,\n    wrap it in a small HTML document, and embed it with `st.iframe`. Highcharts\n    JS runs in the browser.\n  - **Interactive + click events**: render the chart as a bidirectional\n    [Custom Component v2](https://docs.streamlit.io/develop/api-reference/custom-components/st.components.v2.component) —\n    clicked points flow back to Python (highlighting the matching data row), and\n    the chart re-reads the live Streamlit theme. Requires Streamlit ≥ 1.57.\n  - **Static (PNG)**: render server-side with `chart.download_chart(format=\"png\")`\n    and show the PNG with `st.image` (plus a download button). No Highcharts JS\n    runs in the browser; the process talks to the Highcharts export server.\n- Supported chart types: `line`, `spline`, `area`, `column`, `bar`, `pie`,\n  `scatter`.\n\n## Files\n\n| File | Purpose |\n| --- | --- |\n| `streamlit_app.py` | The Streamlit UI: data source, chart controls, caching, the render-mode selector (interactive / click events / static PNG), and the chart embed. |\n| `highcharts_builder.py` | Pure (Streamlit-free) functions that turn a DataFrame into a Highcharts options dict, a `Chart`, and embeddable HTML / PNG bytes. Independently importable and unit-testable. |\n| `highcharts_component.py` | Streamlit Custom Component v2 wrapper for the click-events mode: reuses `build_options`, renders Highcharts client-side, and sends point clicks back to Python. |\n| `sample_data.py` | Pure (Streamlit-free) built-in sample datasets offered when no CSV is uploaded. |\n| `.streamlit/config.toml` | Streamlit theme (app shell) and dev settings (`runOnSave`). |\n| `tests/test_smoke.py` | Builder, component, and sample-data unit tests plus headless `AppTest` interaction tests (including the click round-trip). |\n\n## Test\n\n```bash\nuv run pytest\n```\n\n`tests/test_smoke.py` covers the builder across every chart type (parametrized),\nthe missing-data and scatter edge cases, the brand palette, and the validation\nguards; the component helpers (`json_safe`, `_read_state_value`, `point_label`)\nand the sample datasets; then drives the full app headless with Streamlit's\n`AppTest` — switching controls, the click round-trip, and the guard messages.\n\n## Lint \u0026 format\n\nThis project uses [Ruff](https://docs.astral.sh/ruff/) for linting and\nformatting (config in `pyproject.toml`).\n\n```bash\n# Auto-fix lint issues and format (run before committing):\nuv run ruff check --fix . \u0026\u0026 uv run ruff format .\n\n# Verify only, exactly as CI does (non-mutating):\nuv run ruff check . \u0026\u0026 uv run ruff format --check .\n```\n\nOptional: install the [pre-commit](https://pre-commit.com/) hooks so this runs\nautomatically on every commit:\n\n```bash\nuv tool install pre-commit \u0026\u0026 pre-commit install\n```\n\nVS Code users get format-on-save and fix-on-save via the committed\n`.vscode/settings.json` (install the recommended Ruff extension).\n\n## Type check\n\nThis project uses [ty](https://docs.astral.sh/ty/), Astral's fast Python type\nchecker. Because ty resolves third-party imports from the project venv, run it\nthrough `uv run`:\n\n```bash\nuv run ty check\n```\n\nIt runs in CI and on every commit via pre-commit. A few `highcharts-core` stub\nmismatches are suppressed inline with `# ty: ignore[rule]` (so the rules still\napply everywhere else); see `CLAUDE.md` for details.\n\n## CI\n\nGitHub Actions runs the tests, the Ruff lint/format checks, and the ty type\ncheck on every push to `main` and every pull request\n(`.github/workflows/ci.yml`).\n\n## Notes\n\n- There is **no official Streamlit ↔ Highcharts component** (no `st.highcharts`\n  widget) for the `highcharts-core` object model, so the default interactive\n  mode uses a dependency-free `Chart` → HTML → `st.iframe` bridge, and the\n  click-events mode uses a small inline `st.components.v2` component.\n- In the **interactive** modes, charts load Highcharts JS from the CDN\n  (`https://code.highcharts.com/`), so the browser needs network access. The\n  iframe (default mode) has a fixed height (it does not auto-grow).\n- In **static** mode, the running process must reach the Highcharts export\n  server (`export.highcharts.com` by default). To remove that external\n  dependency, self-host an export server and pass a `server_instance` to\n  `download_chart`.\n\n## Dependencies\n\nRuntime:\n\n- `highcharts-core` — Highcharts for Python charting library\n- `pandas` — DataFrames feeding the charts\n- `streamlit` — app runtime (≥ 1.57 for the click-events Custom Component v2)\n\nDev (in the `dev` dependency group, installed by `uv sync`):\n\n- `pytest` — tests\n- `ruff` — linter and formatter\n- `ty` — type checker\n- `watchdog` — faster, more reliable Streamlit hot-reload\n\n## License\n\nNo license is granted for this project — all rights reserved. With no license,\nthe default of copyright law applies: you may view the code here, but you may\nnot use, copy, modify, or distribute it without the author's permission.\nRendering relies on Highcharts JS (loaded from the CDN) and the Highcharts\nexport server, which are subject to Highcharts' own licensing — free for\nnon-commercial use; commercial use requires a Highcharts license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarylalim%2Fstreamlit-highcharts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarylalim%2Fstreamlit-highcharts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarylalim%2Fstreamlit-highcharts/lists"}